Extract keys, values from 'usrf' Record Type NSAppleEventDescriptor?

2010-02-20 Thread Jerry Krinock
I create an NSAppleScript to read the current window name and URL from Safari and return it as a record [1]. When I execute it, I get a nice-looking NSAppleEventDescriptor with the following -description (line breaks added for readability): http://www.apple.com";) ] }> As you can

Re: Document not Saving Text View Attachment

2010-02-20 Thread Kyle Sluder
On Sat, Feb 20, 2010 at 2:33 PM, Gordon Apple wrote: > Like I said in the post, I tried that.  Same result.  Just to make sure it > had nothing to do with the attachment character, I also tried the following > and got the same result: The point I was making is that you are calling -edited:range:c

Re: Document not Saving Text View Attachment

2010-02-20 Thread Gordon Apple
Hold off guys. I'm getting a s--- load of console messages from a related dynamically loaded menu and possibly an exception thrown. Let me deal with that and see if the problem persists. = Like I said in the post, I tried that. Same result. Just to make sure it

Re: Document not Saving Text View Attachment

2010-02-20 Thread Gordon Apple
Like I said in the post, I tried that. Same result. Just to make sure it had nothing to do with the attachment character, I also tried the following and got the same result: [store beginEditing]; [store insertAttributedString:[[NSAttributedString alloc] initWithString:@"$"] atIndex:index

Re: Document not Saving Text View Attachment

2010-02-20 Thread Kyle Sluder
On Sat, Feb 20, 2010 at 9:11 AM, Gordon Apple wrote: >    [store insertAttributedString:string atIndex:index]; >    NSRange range = NSMakeRange(index, 0); >    [store edited:NSTextStorageEditedAttributes | > NSTextStorageEditedCharacters range:range changeInLength:[string length]]; You should be

Re: Removing item from CollectionView by drag it out.

2010-02-20 Thread Sandro Noël
So should I understand that NCCollectionView as a Drag Source is Broken enough for no one in this list to pay it attention? Has anyone got it working? I'm Confused. Drop destination works like a charm for me, just by implementing the NSCollectionViewDelegate protocol as part of my window contro

Re: Cocoa equivalent for 'InstallApplicationEventHandler'

2010-02-20 Thread Jesper Storm Bache
Your comment only pertains to the addGlobal... You can use addLocalMonitor to only snoop on events in your process. From the header: = Use +addLocal to install an event monitor that receives events before they are dispatched by -[NSApplication sendEvent:]. In this case, your block should

Re: initWithCoder / unarchiveObjectWithData Memory Management Question

2010-02-20 Thread Matt Neuburg
On Sat, 20 Feb 2010 01:47:27 -0500, Thomas Wetmore said: >The question came up because I found a case in my code where I convinced myself I was over-releasing an object created in this fashion You will never over-release an instance if you follow the basic rule - if and only if you yourself copie

Re: NSTableView with PopUpButtonCell column with different content per row

2010-02-20 Thread Matt Neuburg
>Thanks for this example. I've used this technique elsewhere and like it >too, but alas as soon as you want menu separators in the popup this no >longer works. Unless you are aware of some way... Sorry, I wasn't paying attention earlier in this thread. But if the question is getting separators i

Re: Cocoa equivalent for 'InstallApplicationEventHandler'

2010-02-20 Thread Jens Alfke
On Feb 20, 2010, at 3:45 AM, Vikram Sethi wrote: > However, events like keyDown are not handled by the NSApplication class or > its delegate. Ordinarily it doesn't make any sense to type into an app that has no open windows. If you have special hot keys that should do something even in this s

Re: Hillegass printing challenge

2010-02-20 Thread Matt Neuburg
On Fri, 19 Feb 2010 11:56:53 +, Joanna Carter said: >Can I just jump in on this thread and ask where I can find info about printing a document like an invoice, where there is a header and then a list of invoice lines that is possibly longer than one page? Printing in Cocoa is easy - it's jus

Document not Saving Text View Attachment

2010-02-20 Thread Gordon Apple
I have a window with an NSTextView. If I edit the text normally, even adding a single character, it behaves properly, I can save, close, reopen, and the change is present. If I close after edit, it asks to save, like it is supposed to. However, if I programmatically insert an attachment (wi

Re: Monitoring other application preferences changes

2010-02-20 Thread Sandro Noël
> > If I remember correctly, the Apple application you're interested in is the > Dock. > > As I mentioned previously, you'll receive > NSApplicationDidChangeScreenParametersNotification notifications (and > -applicationDidChangeScreenParameters: delegate method invocations) when the > Dock's

Re: Monitoring other application preferences changes

2010-02-20 Thread Ken Thomases
On Feb 20, 2010, at 10:26 AM, Sandro Noël wrote: >> Are both of these applications yours? If so, then >> NSDistributedNotificationCenter is your friend. > > No unfortunately now, one of the is a apple system application. > Thank you all for your valuable input. If I remember correctly, the Appl

Re: Removing item from CollectionView by drag it out.

2010-02-20 Thread Sandro Noël
I've added the --- protocol to my model but when i drag an item out of my frame I receive this stack trace. 'NSFilenamesPboardType' is not a valid UTI string. Cannot use an invalid UTI as a type returned from -writeableTypesForPasteboard: in class DockItem. Proposed Index : 1606412160 Now i se

Re: Monitoring other application preferences changes

2010-02-20 Thread Sandro Noël
> > Are both of these applications yours? If so, then > NSDistributedNotificationCenter is your friend. > > -- > James Bucanek > No unfortunately now, one of the is a apple system application. Thank you all for your valuable input. Sandro.___ Coco

Re: NSData as value in NSManagedObject

2010-02-20 Thread Mikkel Eide Eriksen
Heh, it actually works currently though. That is a straight copy from my running code. Oh, I get it now! selectedObjects is obviously an array, so when I send valueForKey:@"xml" to it, I get an array of the results of that call on each element - thus requiring lastObject. So really the la

Re: NSData as value in NSManagedObject

2010-02-20 Thread Alexander Spohr
Am 20.02.2010 um 16:29 schrieb Mikkel Eide Eriksen: > NSData *xmlData = (NSData *)[[[treeController selectedObjects] > valueForKey:@"xml"] lastObject]; //HERE'S THE PROBLEM Well, yes. You ask your xml for lastObject. That won’t work. What you want is this: [[[treeController selectedObjec

Re: NSData as value in NSManagedObject

2010-02-20 Thread Mikkel Eide Eriksen
Hi Jerry Thanks for the reply, here are the methods in question. Bear in mind I'm still new to Core Data so there are probably some grievous things going on (the project is GC, by the way). addXML:toBucket:atPath: gets called when self receives new XML. I choose from the added XML via an

Re: Monitoring other application preferences changes

2010-02-20 Thread James Bucanek
Sandro Noël wrote (Friday, February 19, 2010 6:24 PM -0500): > I'm trying to figure out how to monitor the preferences changes in another > application's preferences I would like my application to react to changes made > in another application settings by the use

Re: Cocoa equivalent for 'InstallApplicationEventHandler'

2010-02-20 Thread Uli Kusterer
On 20.02.2010, at 12:53, Tom Davie wrote: > You want NSEvent's > > + (id)addGlobalMonitorForEventsMatchingMask:(NSEventMask)*mask* handler:(void > (^)(NSEvent*))*block* > *and* > * > > + (id)addLocalMonitorForEventsMatchingMask:(NSEventMask)mask handler:(NSEvent* > (^)(NSEvent*))block Nope, tha

Re: Cocoa equivalent for 'InstallApplicationEventHandler'

2010-02-20 Thread Tom Davie
You want NSEvent's + (id)addGlobalMonitorForEventsMatchingMask:(NSEventMask)*mask* handler:(void (^)(NSEvent*))*block* *and* * + (id)addLocalMonitorForEventsMatchingMask:(NSEventMask)mask handler:(NSEvent* (^)(NSEvent*))block Bob * On Sat, Feb 20, 2010 at 11:45 AM, Vikram Sethi wrote: > Hi, >

Cocoa equivalent for 'InstallApplicationEventHandler'

2010-02-20 Thread Vikram Sethi
Hi, I am rewriting the event handling mechanism of my app in Cocoa. It is in Carbon as of now. Is there a Cocoa equivant for InstallApplicationEventHandler(), so that I can listen to event at the application level? As I understand, as per the NSResponder chain hierarchy, I can get the events on th

Re: initWithCoder / unarchiveObjectWithData Memory Management Question

2010-02-20 Thread Uli Kusterer
On 20.02.2010, at 07:47, Thomas Wetmore wrote: > (error handling removed), has myObject been retained, or must I now retain > it. The unarchiveObjectWithData class method causes myObject's class's > initWithCoder object method to run. I assume that initWithCoder obeys memory > management rules a

Re: setAction:@selector is not working ?

2010-02-20 Thread Graham Cox
On 20/02/2010, at 7:45 AM, David M. Cotter wrote: > NSMenuItem* > nsMenuItem([platMenu itemAtIndex: itemIndexS]); > DVAMacMenuItem* dvaItem((DVAMacMenuItem > *)nsMenuItem); > >

Re: initWithCoder / unarchiveObjectWithData Memory Management Question

2010-02-20 Thread Quincey Morris
On Feb 19, 2010, at 22:47, Thomas Wetmore wrote: > from the NSKeyedUnarchiver (or any unarchiver) class. > > After the following lines of code run ... > > NSData* data = [NSData dataWithContentsOfFile: myObjectPath]; > myObject = [NSKeyedUnarchiver unarchiveObjectWithData: data]; > > (error han