Questions tagged [scripting-bridge]

Scripting Bridge is a Cocoa framework that enables developers to communicate with scriptable applications in Objective-C.

Scripting Bridge is a framework and a technology that makes it much easier for Cocoa developers to control and communicate with scriptable applications. Instead of incorporating AppleScript scripts in your application or dealing with the complexities of sending and handling Apple events, you can simply send Objective-C messages to an object that represents an application with a scripting interface. Scripting Bridge Programming Guide

192 questions
4
votes
2 answers

Incorrect (but non-error-throwing) return value with a Scripting Bridge call to Finder under 10.6

I've been skimming lots and lots of Scripting Bridge-related threads on StackOverflow and elsewhere, and can't seem to make any headway on figuring out why a block of Cocoa code that makes a Scripting Bridge call to the Finder no longer works…
Steve V.
  • 153
  • 9
4
votes
3 answers

How to wrap Objective-C, to be called from Python?

I have created an objective-C framework that I would like to import and access through a python script. I understand how to import this stuff in Python, but what do i need to do on the obj-c side to make that framework importable? Thanks
D.C.
  • 15,340
  • 19
  • 71
  • 102
4
votes
1 answer

Grab audioCDPlaylist via ScriptingBridge does not work with macOS Mojave Beta

I have a application which gets audioCDPlayList from iTunes. This app works fine up to macOS High Sierra, but does not work correctly on macOS Mojave Beta 3 (18A326h). I have investigated the reason and then found that the following strange…
xanadu6291
  • 931
  • 10
  • 20
4
votes
1 answer

Scripting Bridge and filtering SBElementArrays using NSPredicate and FourCharCodes

I'm experimenting with Scripting Bridge for the the first time, but have run into an issue with filtering a SBElementArray according to a NSPredicate containing a FourCharCode enum constant as a criterion. I wrote a trivial program to identify the…
Nick Hutchinson
  • 5,044
  • 5
  • 33
  • 34
4
votes
1 answer

Simple Tutorial to Create a Scriptable Cocoa Application (Scripting Bridge)

Can anyone point me to a really simple hello world type of application that introduces ScriptingBridge? Something that takes you step by step to creating a 1 class - 1 method project that can be instantiated from ruby/python/applescript, etc. I'm…
Dave Rapin
  • 1,471
  • 14
  • 18
4
votes
3 answers

ScriptingBridge Finder POSIX path

is it possible to get the POSIX path or target to the frontmost window using the Scripting Bridge framework? I'm using FinderApplication *theFinder = [SBApplication aplicationWithBundleIdentifier:@"com.apple.Finder"; but I can't find anything in…
sergiobuj
  • 2,318
  • 2
  • 21
  • 24
4
votes
1 answer

Entitlement Keys/Access Groups for Scripting Targets

I can't seem to figure out how to identify what entitlement keys are available for a given app. How does one query an application for its entitlement keys? Example: iTunes has these entitlement keys: com.apple.iTunes.playerInfo,…
4
votes
1 answer

Monitoring Keynote 6 presentation using ScriptingBridge

I've developed an application which gathers some information on presentations and monitors the behaviour of the presenter during the presentation. The applications is an OS X app build in Objective-C with the Cocoa Framework In the past I've used…
Madsen
  • 396
  • 1
  • 2
  • 12
4
votes
1 answer

How do I let Scripting Bridge generate Objective-C classes at runtime?

I was updating a Scripting Bridge glue file today (for Mail.app), and noticed that the sdp(1) man page reads: You do not need to create a corresponding implementation file; Scripting Bridge will create the class implementations at runtime. That…
jmah
  • 2,216
  • 14
  • 16
4
votes
1 answer

Get iTunes'/Finder's default album art image

Part of my application's functionality is that it gets the currently playing iTunes track's album art (using Scripting Bridge). I'm able to do this fine. However, when a track isn't playing, I'd like to get the default album art that both iTunes and…
Seb Jachec
  • 3,003
  • 2
  • 30
  • 56
3
votes
2 answers

Getting selected/clicked item on desktop using Applescript

I need to fetch the currently selected item on the desktop or the desktop item that was right clicked . Depending on the path for this item(s) I will have to perform some action. Can this be done using applescript ??? I am currently using the logic…
3
votes
0 answers

Passing an NSArray populated with NSDictionaries to a NSAppleScript

So I have an Apple Script that is running one of the functions of my program like so: [ NSThread detachNewThreadSelector:@selector(runAppleScriptTask) toTarget:self withObject:nil]; Using this…
3
votes
1 answer

How to have Xcode not care about errors coming back from a custom script (/dev/null)?

I have a custom script in Xcode which returns an error, but suppose I don't care. Xcode doesn't care about /dev/null and won't compile sdef "$INPUT_FILE_PATH" | sdp -fh -o "$DERIVED_FILES_DIR" --basename "$INPUT_FILE_BASE" --bundleid `defaults…
StuFF mc
  • 4,137
  • 2
  • 33
  • 32
3
votes
2 answers

Sending a file from desktop app to iPad via iTunes using scripting bridge

I want to find out if it's possible to automate a process of exporting (a zip) from a desktop app into an app on the iPad via file sharing in iTunes. The most likely technique I've found is by scripting Bridge.
kenblaue
  • 31
  • 2
3
votes
2 answers

Scripting Bridge for Send Email - Error: Object not added to container yet

We are using the SBSendEmail Apple code to create an email to be sent by email app. MailApplication *mail = [SBApplication applicationWithBundleIdentifier:@"com.apple.Mail"]; mail.delegate = self; MailOutgoingMessage *emailMessage = [[[mail…
John
  • 538
  • 4
  • 18
1
2
3
12 13