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

Create playlist in iTunes with Python and Scripting Bridge

How do you create a playlist using Python and Scripting Bridge? So far I have : from Foundation import * from ScriptingBridge import * iTunes = SBApplication.applicationWithBundleIdentifier_("com.apple.iTunes") newPlaylist =…
abroekhof
  • 796
  • 1
  • 7
  • 20
3
votes
1 answer

How do I create a C Pointer in MacRuby?

I am working with a C Framework in MacRuby which has a structure int CPhidget_getSerialNumber(CPhidgetHandle phid,int * serialNumber) You can see the full documentation here (if you are interested). In MacRuby I have tried the following: i =…
tsugua
  • 197
  • 1
  • 13
2
votes
1 answer

How to fetch a specific iTunesTrack instance from iTunes via the Scripting Bridge using persistenID?

Using the iTunes Scripting Bridge interface, I need to fetch a particular iTunesTrack by its persistentID. I closely examined the header file produced sdp/sdef but it looks like there is no method in the existing interface for performing any kind…
SMJ
  • 21
  • 1
  • 2
2
votes
1 answer

Can't send attachments from draft (Mail.app)

I am trying to send a draft created with Mail.app. As drafts have no send method, I'm having to get all the content from the draft, and create a new e-mail with it. That should be ok, but... Attachments aren't getting through. I am using this:…
EduAlm
  • 813
  • 3
  • 11
  • 27
2
votes
1 answer

Twitter for Mac Integration within Cocoa app

I see that both XCode and Skype permits to select text and send a tweet through Twitter for Mac application, I suppose to do this using the Apple Scripting Bridge, but I was unhappy after I generated the Twitter for Mac header file: Gemini:~…
loretoparisi
  • 15,724
  • 11
  • 102
  • 146
2
votes
1 answer

Scripting Bridge objective-c PagesWord

I'm trying to modify an existing Pages document from within my application using the Scripting Bridge. I've followed all steps mentioned in the documentation: I created a header file and thoroughly examined it, but I just can't figure out how how to…
Frog
  • 1,631
  • 2
  • 17
  • 26
2
votes
1 answer

Objective C Scripting Bridge with FileMaker Pro 11

I'm trying to use scripting bridge to communicate with FileMaker pro 11, I can get it to launch the App, open the correct database file but can't get any further. Has anyone got an example scripting bridge file for FileMaker Pro, once I can get my…
Andre
  • 21
  • 1
2
votes
0 answers

Get the current selection from macOS Finder

It seems like the only way to get to the currently selected files/folders of the macOS Finder is via the Scripting Bridge. The SwiftScripting project provides some pre-generated extensions to use. The code is rather simple: public func…
tcurdt
  • 14,518
  • 10
  • 57
  • 72
2
votes
0 answers

Retrieving correct timestamp for image in Aperture

A question for the Aperture and Cocoa developers out there… I use Aperture and @Fraser Speirs' FlickrExport plugin to manage my photos and upload them to Flickr. FlickrExport sets custom tags in Aperture with the Flickr photo ID (among other…
blalor
  • 612
  • 4
  • 9
2
votes
0 answers

Error with the ScriptingBridge email message forwarding

I'm going to develope own email- plugin included to my application. At the moment I have a problem with the email forwarding to the third user. There is the code snippet: EmailApplication.h MailApplication *mail; @property(nonatomic, retain)…
user775844
  • 21
  • 2
2
votes
2 answers

get a specific track in itunes via ScriptingBridge

I'm updating my OS X program to accept iTunes drops, modify the metadata in the file, then refresh (Get Info) the dropped file(s) so iTunes can update its' metadata library. I've got the drops working, which provide a dictionary of some misc info…
Arr MiHardies
  • 185
  • 1
  • 9
2
votes
3 answers

Extend iTunesApplication class with Categories

I am just learning how to use ScriptingBridges. I made a method that slowly fades the volume on iTunes, and would like to make it a category so I can do the following: iTunesApplication* iTunes = [SBApplication…
2
votes
2 answers

iTunes Scripting Bridge - How to play a specific track

I am writing a mac application that uses the scripting bridge to control iTunes. I have generated the header file iTunes.h, and the SBApplication object can tell me all kinds of wonderful things. However, the commands seem very limited. There is a…
Tom Schulz
  • 612
  • 6
  • 23
2
votes
1 answer

Scripting Bridge for iTunes in Swift 2 - cannot specialize non-generic type

I'm trying to convert the Scripting Bridge header generated by sdef and sdp into Swift in order to be able to use it without a bridging header and obj-c wrapper. I think I came pretty close with the help of SwiftingBridge but I'm still facing an…
beeb
  • 1,187
  • 11
  • 32
2
votes
1 answer

Scripting Bridge: Combining SBElementArrays

According to Apple's documentation on Scripting Bridge performance, we should strive to use batch operations on SBElementArrays, since Apple event calls are expensive. ... whenever possible you should always use one of the “batch operation” array…
Matt
  • 2,651
  • 1
  • 21
  • 28