Questions tagged [nsappleeventdescriptor]

Questions related to NSAppleEventDescriptor: the basic building block for Apple events.

This NSAppleEventDescriptor is the the basic building block for Apple events and it is used to retrieve information about an Apple Event in a Cocoa application. This class is useful for creating event descriptor objects to return to other objects, or to extract information about an Apple Event descriptor (NSAppleEventDescriptor is a wrapper for the underlying Apple event descriptor data type).

8 questions
5
votes
0 answers

Send data to another app and get response from it

I'm trying to communicate apps with each other. I'm handling Apple Events in my first application with NSAppleEventManager.shared().setEventHandler(self, andSelector: #selector(handleGetURLEvent), forEventClass: AEEventClass(kInternetEventClass),…
3
votes
4 answers

How to pass date information to AppleScript?

I am making one app that can run AppleScript via NSAppleScript. Everything had been fine but I haven't been able to figure out how to pass date information from my app to AppleScript. (Since AppleScript has date type, I suppose this is possible) The…
Terry
  • 337
  • 2
  • 9
3
votes
2 answers

Unable to unwrap NSAppleEventDescriptor in SWIFT

I'm having an Applescript which gives me a result. But I am unable to unwarp the value to String so i can use it. var set: String = "set windowTile to \"\"\n" var tell: String = "tell application \"System Events\"\n" var setFrontApp: String = "set…
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

-[NSAppleScript executeAndReturnError:] gives error with script that works in AppleScript Editor

I'm trying to find out if QuickTime player is paused or playing from Cocoa. I use the following small AppleScript in Script Debugger and AppleScript Editor and it returns true or false as expected: tell application "QuickTime Player" to tell…
Chuck
  • 4,662
  • 2
  • 33
  • 55
0
votes
1 answer

Parse bmrk NSAppleEventDescriptor from final cut pro x

In Final cut pro, I shared to my application. With following code [[NSAppleEventManager sharedAppleEventManager] setEventHandler:self andSelector:@selector(handleAppleEvent:withReplyEvent:) forEventClass:kCoreEventClass…
muyoungko
  • 73
  • 2
  • 8
0
votes
1 answer

Opening Messages programatically with pre filled fields on macOS

I am trying to make QR codes actionable on macOS. I found that I can open Messages app just by using imessage as URI or sms as URI: NSString *message = @"imessage://your@appleid.com"; [[NSWorkspace sharedWorkspace] openURL:[NSURL…
Marek H
  • 5,173
  • 3
  • 31
  • 42
0
votes
1 answer

NSAppleEventDescriptor returned from Scripting bridge unwrapping problems

I am working on OSX, Xcode 8.2. Objective-C. I use scripting bridge to adress Adobe InDesign. I have a pretty long AppleScript i want to translate to Objective-C with Scripting-Bridge to take advantage of its background-task possibilities. For…