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
2
votes
4 answers

Linking problems with a category on Scripting Bridge

I am trying to write a category over iTunesTrack with associated objects (an NSMutableDictionary and an NSNumber) #import "iTunes.h" #import @interface iTunesTrack (dictionary) - (NSMutableDictionary*) getDictionary; - (NSNumber*)…
abroekhof
  • 796
  • 1
  • 7
  • 20
2
votes
1 answer

Scripting bridge and generate Microsoft Word header file

I’m trying to get a Cocoa application to connect to Microsoft Word, and from my search it seems that the only way, is to use Scripting Bridge and generate a word header file. However, using the approach explained in Apples example project…
Steffen Andersen
  • 203
  • 4
  • 10
2
votes
0 answers

Objective-C: get detailed menu information from external application

This question (Objective-C: get menu information from external application) shows how to get the top-level menu items for an external application on OS/X. But it doesn't show how to iterate down into lower-levels of the menus. It also doesn't show…
Ted Wise
  • 166
  • 1
  • 5
2
votes
1 answer

OS X: Accessing the Main Menu of The Frontmost Application

---edit--- there is an application called Keycue that performs this function. ---/edit--- ---edit edit--- this is a duplicate. Get a list of all shortcuts from another application ---/edit edit--- I am struggling to write an application that takes…
Ian Ray
  • 117
  • 4
2
votes
0 answers

How to generate a header file for Reminders.app

I’m a bit familiar with Scripting Bridge, and have used it for controlling the play/pause/back/next functions in iTunes. Through sdef and sdp I was able to create an iTunes.h file, with which I could declare an iTunesApplication object. When I tried…
rounak
  • 9,217
  • 3
  • 42
  • 59
2
votes
2 answers

How to make Chrome open a URL using ScriptingBridge in Objective-C?

I have working Objective-C code that uses ScriptingBridge to make Safari open a URL. Something like: #import "Safari.h" /* created by executing "sdef /Applications/Google\ Chrome.app | sdp -fh --basename GoogleChrome" */ if ((safariApp =…
2
votes
1 answer

Closing windows with MacRuby and the Scripting Bridge

I'm trying to write a quick script that will close all but the current window for the terminal application. This script uses MacRuby and the Scripting Bridge. Heres' what I have so far: #!/usr/local/bin/macruby framework "Foundation" framework…
LandonSchropp
  • 10,084
  • 22
  • 86
  • 149
2
votes
1 answer

Objective C - Very slow code

I'm using ScriptingBridge.framework in order to interact with Mail.app. The following code is taking about 30 seconds to load 100 messages. I'm running it on a 2.8GHz Core i7 MacBook Pro with 4GB (1333 MHz DDR3) mem. My OS is 10.7.4. MailApplication…
Bob Rivers
  • 5,261
  • 6
  • 47
  • 59
2
votes
1 answer

Cocoa: Receive callback when iTunes song changes

I'm writing a piece of functionality for my chat client that will update the user's status with their currently playing iTunes song, much like Skype and similar other chat clients do. I currently just use ScriptingBridge's methods to get iTunes'…
Tristan
  • 3,058
  • 6
  • 40
  • 68
1
vote
2 answers

Finding the front Safari window using the ScriptingBridge and Objective-C

I'm trying to get the URL of the front-most, active Safari window (Safari 5.2 running in Mountain Lion Developer Preview 2) through the ScriptingBridge, but can't find any property to determine if the window is the front one. SafariApplication…
Erik Tjernlund
  • 1,963
  • 13
  • 12
1
vote
2 answers

SBApplication error

To use ScriptingBridge with iTunes, I used: iTunesApplication *iTunes = [SBApplication applicationWithBundleIdentifier:@"com.apple.iTunes"]; However, when I run the application, (I have traced the source of the error to the above line), I get a…
1
vote
2 answers

How do I bind NSPopUpButton with ITunesPlaylist objects in MacRuby?

I'm trying to populate an NSPopUpButton with an array of ITunesPlaylist objects. I got the NSArrayController bind to NSPopUpButton app = SBApplication.applicationWithBundleIdentifier("com.apple.iTunes") playlists =…
goofrider
  • 231
  • 1
  • 8
1
vote
1 answer

Play specific title in iTunes via ScriptingBridge

I'm trying to write an application that interacts with iTunes via ScriptingBridge. I works well so far, but the options of this method seem to be very limited. I want to play song with a given name, but it looks like there's no way to do this. I…
Chris
  • 15
  • 5
1
vote
1 answer

MacRuby ScriptingBridge loading speed

Is there a faster way to load scripting bridge applications from MacRuby? When I make the SBApplication object for Adobe InDesign it takes more than 10 seconds to load. Here's the code I've been using: framework 'ScriptingBridge' indesign =…
Josh Voigts
  • 4,114
  • 1
  • 18
  • 43
1
vote
0 answers

wxPython with ScriptingBridge causes Seg Fault on exit

This is a very odd situation that I can not seem to figure out. I'm writing an application with wxPython on OSX Lion (wxpython version 2,9,3,1). Whenever I import from ScriptingBridge and do something as simple as create a frame and then close it,…
intargc
  • 3,051
  • 5
  • 36
  • 52