Questions tagged [appleevents]

An Apple event is a type of interprocess message that can specify complex operations and data.

An Apple event is a type of interprocess message that can specify complex operations and data. Apple events allow you to gather all the data necessary to accomplish a high level task into a single package that can be passed across process boundaries, evaluated, and returned with results. The Mac OS uses Apple events to communicate with applications. Apple events are also an essential part of the AppleScript scripting system, which allows users to automate actions using scriptable applications—applications that can respond to a variety of Apple events by performing operations or supplying data.

84 questions
1
vote
1 answer

how to prevent or extend AppleEvent or SpeechRecognitionServer timed out?

I am working on a SpeechRecognition project and I am pretty much done. However, there is one thing I cant quite figure out. When I launch my application it listens to my commands, and if I stay quite or don't say the commands then it is giving me…
1
vote
0 answers

Testing if an NSRunningApplication UI is idle

Outside of the context of a UI Unit Test, is there a way for a third-party application to see if an a particular running application on the system is busy processing events, or beach-balling, or is ready for a next event? Either by polling or with a…
iluvcapra
  • 9,436
  • 2
  • 30
  • 32
1
vote
1 answer

Python in OS X: Detect multiple monitors and move application window to specific monitor

Question: Is there a way to have Python detect when running the code in OS X, if there is more than one monitor active? Is it then, possible to move a specific OS X application window to one of those monitors by choosing? FYI: I have previously…
P A N
  • 5,642
  • 15
  • 52
  • 103
1
vote
4 answers

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…
jxpx777
  • 3,632
  • 4
  • 27
  • 43
1
vote
1 answer

Identifying AppleEvents in main message loop

I have a main message loop. I'm looking for a way to check if the event is an AppleEvent and if it's Event Class is of 'MyClass' then do something. I've looked in NSEvent reference and was lost not finding what i need. Please can someone suggest an…
Sanich
  • 1,739
  • 6
  • 25
  • 43
1
vote
1 answer

Registering for AppleEvents

I'm trying to get started with AppleEvents. I've this simple registration and handle with logs: static OSErr HandleOpenApplication(const AppleEvent* event, AppleEvent* ev, SRefCon sr) { LOG_HIGH("@@@@@@@@ Got Apple Event @@@@@@@"); return…
Sanich
  • 1,739
  • 6
  • 25
  • 43
1
vote
2 answers

Catch registered URL scheme and launch app

I managed to launch my application whenever a URL scheme is called via the browser, by putting this scheme in the info.plist and adding these 2 lines: NSAppleEventManager *appleEventManager = [NSAppleEventManager…
jeanpaul62
  • 9,451
  • 13
  • 54
  • 94
1
vote
2 answers

Tap AppleEvents being sent to another application

Is it possible to monitor or tap the stream of Apple Events being sent to a process, in the same way you can tap Quartz Events? I have an application that talks to another application to force it to import files, but it does so in a way that's…
iluvcapra
  • 9,436
  • 2
  • 30
  • 32
1
vote
1 answer

Launching application with NSPasteboard data

I would like to launch applications (or send to them using AppleEvents) using NSPasteboard data just like is done in the Finder when you drag and drop a file, text, image on an application (or in the Dock) and it launches or invokes the data in the…
GenericPtr
  • 677
  • 1
  • 8
  • 18
1
vote
1 answer

How do I interprete a record returned as a NSAppleScript result

I run an applescript from an objective-c application using NSAppleScript the executeAndReturnError method. This returns an NSAppleEventDescriptor object containing the result of the script. My script returns an applescript record. How do interpret…
1
vote
2 answers

How to relaunch finder application

I am using following applescript to relaunch finder application. osascript -e "tell application \"Finder\"" -e "delay 1" -e "try" -e "quit" -e "delay 1" -e "activate" -e "end try" -e "end tell" But sometimes this script is not relaunching…
Parag Bafna
  • 22,812
  • 8
  • 71
  • 144
0
votes
0 answers

Running 'System Events' from Excel For Mac Via VBA Results in Invalid Procedure 5 Error

I am trying to run a very simple apple script from VBA. The VBA code is: NavigationJunk = AppleScriptTask("Budget Report Apple Scripts/NavigationMoveWindowsAppleScript.scpt", "NavigationMoveWindowLeftHandler", "") The script reads: on…
Andrew
  • 21
  • 1
0
votes
1 answer

AppleEvent: how to debug `eventDidFail`?

I am getting this error from SIMBL in the console: 05.09.11 17:00:09,165 SIMBL Agent: eventDidFail:'tvea' error:Error Domain=NSOSStatusErrorDomain Code=-1708 "The operation couldn’t be completed. (OSStatus error -1708.)" (the AppleEvent was not…
Albert
  • 65,406
  • 61
  • 242
  • 386
0
votes
1 answer

Automation failing when running Apple script

Hello I am using this Apple script in Automator to auto launch and play in full screens video using quick time. tell application "QuickTime Player" set theMovie to open file "Users:ronaldwise:Movies:Jarvis Startup.mp4" tell theMovie …
0
votes
1 answer

Authorize UNIX command to control an application

I want to set up an Automator Quick Action that runs the bbdiff command, and passes it the selected files in the Finder. I created a Quick Action, and set it to receive "files or folders" in "Finder.app". Then I added the "Run Shell Script" action,…
JW.
  • 50,691
  • 36
  • 115
  • 143