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
2
votes
1 answer

Apple Event sends Activate gives an error

I am working on C application which uses AppleEvents. So far I am trying to do simple example which sends Activate to the Terminal. This is what I have: int main() { AppleEvent theEvent; char* arg = "com.apple.Terminal"; AEAddressDesc…
RuLoViC
  • 825
  • 7
  • 23
2
votes
1 answer

electronJS / OSX - open file with my application, how to use the Apple event?

My application is an Electron.js app I type this command in the terminal to open a file with my app: open "/Users/Bob/Pictures/test.jpg" -a myApp In my process.argv I get an Apple event, something like '-psn_0_#######', How do I use this event to…
Daniel
  • 667
  • 2
  • 11
  • 25
2
votes
3 answers

OSX: Lock the screen programmatically

I'm looking for a way to lock the user screen programmatically without putting the Mac asleep. Right now, i'm able to trigger the lock screen with the kAESleep event but it's more a hack and it put the computer asleep. Is it possible ? Thanks
M to the K
  • 1,576
  • 3
  • 17
  • 27
2
votes
1 answer

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:…
mahal tertin
  • 3,239
  • 24
  • 41
2
votes
2 answers

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…
jldupont
  • 93,734
  • 56
  • 203
  • 318
2
votes
2 answers

How to accept "open document" events in py2app based Python app when the app is already running?

I've been building a 64 bit Python 3.4.2 app on OS X 10.10, which I bundle as a Mac app using py2app 0.9. I have adapted the app's Info.plist file, so that OS X knows that files with a certain file name suffix can be opened by my app. When a user…
André Aulich
  • 190
  • 10
2
votes
3 answers

Programmatically enter text into any application

Is there a proof-of-concept Objective-C executable that enters some text into an application and then clicks the mouse, using Apple events and not AppleScript? e.g. the AppleScript equivalent of tell application "System Events" tell process…
2
votes
1 answer

Application exit event

I am developing an application in cocoa. My application shows a pop up sheet initially. 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 can't exit the…
MobX
  • 2,640
  • 7
  • 33
  • 54
2
votes
2 answers

Creating an AppleEvent descriptor for an alias in OS X 10.8

I have the following code in a project NSAppleEventDescriptor *JHCreateAliasDescriptorForURL(NSURL *aURL) { NSAppleEventDescriptor *retObj = nil; FSRef fsReference; if (CFURLGetFSRef((__bridge CFURLRef)aURL, &fsReference)) { …
iluvcapra
  • 9,436
  • 2
  • 30
  • 32
1
vote
2 answers

Contextual Menu Plugins for Leopard OS

I am writing Contextual Menu Plugins for Leopard OS and referring Writing Contextual Menu Plugins for OS X, part 1 article by Brent Simmons. My plugin is working fine. Is there any way to move my test menu into main menu (above the Label)?
Parag Bafna
  • 22,812
  • 8
  • 71
  • 144
1
vote
1 answer

AEInstallEventHandler handler not being called on startup

I've installed a Apple Event handler for URL's in my app: OSStatus e = AEInstallEventHandler( kInternetEventClass, kAEGetURL, NewAEEventHandlerUPP(AppleEventProc), …
fret
  • 1,542
  • 21
  • 36
1
vote
0 answers

macOS app no longer can compose e-mail via AppleScript if sandboxed

I have a macOS app with hardened runtime (with enabled "AppleEvents") that uses AppleScript to create a preconfigured email addressed to us. Works like a charm. Since we want to distribute via App Store, I had to sandbox the app. So I added the…
1
vote
1 answer

How to login a remote Mac using AppleScript?

What I need to achieve is this, using AppleScript: Wake a remote iMac Input password Accept password to login What I succeeded to do so far was enabling Remote Events and connecting to the iMac but now I’m stuck. Here is what I tried so far: set…
1
vote
0 answers

facing issue in our automation system when one app wants to communicate with other app using the AppleEvent from MacOS 10.14

I am facing issue in our automation system when one app wants to communicate with other app using the AppleEvent. We have one automation utility (QASoapLib.app) which is present on the mac client machine in which the tests are performed on the…
1
vote
2 answers

Send multiple parameters with apple event

I am trying to send an apple event to an application we have developed. I want to be able to call the apple event, and at the same time pass parameters with the event. eg acctid, acctpassword, order number. I'm not sure how to format the apple event…
Stephen Baugh
  • 673
  • 1
  • 9
  • 24