appleevents

How can I troubleshoot my custom URL scheme?

I set up a simple event handler as mentioned here, but it appears that the selector isn't called. I put the code in my AppDelegate class and wired up the delegate in IB. Tried putting in some NSLog()s and breakpoints in the selector I expect to be called, but none of it is hit. The URL scheme works inasmuch as it launches my app, but it ...

How to Extract AppleScript Data from a NSAppleEventDescriptor in Cocoa and Parse it

Hello! What I'm doing is executing an AppleScript inside of Cocoa. It returns some data as a NSAppleEventDescriptor, which NSLog() prints like so: <NSAppleEventDescriptor: 'obj '{ 'form':'name', 'want':'dskp', 'seld':'utxt'("69671872"), 'from':'null'() }> I want to take that data and turn it into a NSDictionary or NSArray, or someth...

How to send a "Cmd-C" keystroke to the active application in objective-c, or tell the application to do a copy operation?

Getting the active application is not a problem, I already have this implemented. What I want to know is how to send a "Cmd-C" key combination to the active application so it puts the selected text in the clipboard (general pasteboard). Or even better: how to tell the active application to do a copy operation without sending the keystr...

Application exit event

Hi all, I am developing an application in cocoa .My application shows a pop up sheet initially .Now i need to know which event is fired when we try to exit the application by right clicking and selecting "exit" on the icon in dock,because i cant exit the appication because of the popup sheet ..looking for a solution ...

Is there a Cocoa equivalent of Apple Event Manager?

Is there a way to handle Apple Events (namely starting the app from a custom protocol link like myapp://do/something/cool) without using the Carbon APIs? If not, is it safe to assume that these APIs are not going to go away in the next release of OS X? ...

How do I get the window id and tab number of a Terminal window using AppleScript via the ScriptingBridge?

I can open a Terminal tab using the following AppleScript: tell application "Terminal" set myTab to do script "exec sleep 1" get myTab end tell This returns a string like: tab 1 of window id 3263 of application "Terminal". This is great, I can see the window id 3263 and tab number 1 (although I don't know how to query myTab to...

iTunes Apple Events API

I'd like to control iTunes through Objective-C ( I just can't get Python appscript installed correctly on my OS/X 10.6.3 system ... that would have been my first choice ). From what I gather, the IPC on Cocoa is based on Apple Events : is there either: Online documentation on iTunes / Apple Events API ? Instrospection mechanism to get...

GCD and AppleEvents / NSOperationQueue and AppleScript

As i understood, the threads provided by GCD do have a runloop but no source/port. Now i use some of methods that call AppleScripts thru AppleEvents inside an NSOperationQueue. And sometimes my app crashes with following stacktrace. my questions: Usage of AppleScript inside a NSInvocationOperation or NSBlockOperation Usage of AppleE...

Help with ODBEditorSuite Apple Event voodoo please?

I'm working on a simple little text editor that implements the editor portion of the ODBEditorSuite of Apple Events so that my app can work with QuickCursor for providing editing capabilities. The events that need to be sent are pretty straightforward and share a lot of the same code, so I've wrapped it up into a method like this: -(BOO...

appleevent versus notification

Hello, I am looking for a high performance inter process communication system in macos X. What is the best system? AppleEvents or NSNotifications? Thanks :) ...

SBApplication : how to send raw data

Hello, I woudl like to send raw data (a void*) using SBApplication sendEvent Unfortunaltly I've found no documentation about this. Do you have any idea to achieve this? Thanks in advance for yoru help, Regards, ...

Where is the leak?

I have a memory leak in this code. I am busting it since 2 weeks and I am starting to be mad. Thanks in advance for your help :) +(void) makeEvent:(int) event:(AppleEvent *)theEvent { int sig = 'dock'; OSErr err; AEAddressDesc targetDesc; targetDesc.descriptorType = typeNull; targetDesc.dataHandle = nil; err = ...

Way to listen in on all Apple Events?

I'm looking for a way to listen in to all Apple Events send by any program to any other program. There was an app, AEMonitor, that used to do this but it is abandonware as of now. Is there a known way to do this via cocoa, carbon, etc? Any help MUCH appreciated. -- Target OS is 10.6 -- Carification: I'm looking to monitor ALL appl...