scriptingbridge

What is the type of an enum whose values appear to be strings?

I am working with Apple's ScriptingBridge framework, and have generated a header file for iTunes that contains several enums like this: typedef enum { iTunesESrcLibrary = 'kLib', iTunesESrcIPod = 'kPod', iTunesESrcAudioCD = 'kACD', iTunesESrcMP3CD = 'kMCD', iTunesESrcDevice = 'kDev', iTunesESrcRadioTuner = 'kTun'...

How can I close a Window using the OS-X ScriptingBridge framework, from Perl?

Problem... Since MacPerl is no longer supported on 64bit perl, I am trying alternative frameworks to control Terminal.app. I am trying the ScriptingBridge, but have run into a problem passing an enumerated string to the closeSaving method using the PerlObjCBridge. I want to call: typedef enum { TerminalSaveOptionsYes = 'yes ' /* ...

ScriptingBridge causes iTunes to relaunch after quit

I'm working on a Cocoa app that monitors what you're listening to in iTunes, and since I'm targeting Mac OS 10.5 and higher, I've decided to use Scripting Bridge. If I try to close iTunes too close to the time that my app polls it for the current track, iTunes will immediately relaunch! The only way to reliably prevent this behavior is ...

How do I get the window id and tab number of a Terminal window using AppleScript via the ScriptingBridge?

I can open a Terminal tab using the following AppleScript: tell application "Terminal" set myTab to do script "exec sleep 1" get myTab end tell This returns a string like: tab 1 of window id 3263 of application "Terminal". This is great, I can see the window id 3263 and tab number 1 (although I don't know how to query myTab to...

QuickTimeX in Applescript / Scripting Bridge

I'd like to be able to grab the metadata of the currently playing file in Quicktime X using ScriptingBridge and Ruby, so far I have the following code require 'osx/cocoa' OSX.require_framework 'ScriptingBridge' @app = OSX::SBApplication.applicationWithBundleIdentifier("com.apple.QuickTimePlayerX") @app.documents.each do |movie| # Wh...

Using ScriptingBridge framework for communicating with Entourage

Hi, The motivation for my question is the following doc, which describes how mail.app could be integrated using ScriptingBridge: http://developer.apple.com/mac/library/samplecode/SBSendEmail/Introduction/Intro.html I tried to apply a similar technique with Entourage as well but could not get any results so far. I understand that using...

ScriptingBridge Finder POSIX path

Hi, 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 "Finder.h" that could work. ...

Working with a file by pathname/URI using Finder + ScriptingBridge

I'm using the generated Finder.h headers from the sdef utility, and it appears that a lot of Finder SB methods require objects of type FinderItem to do anything meaningful with. How would I go about creating one of them objects based on a path to or URI of the file? The farthest I've got is the [SBObject initWithProperties] method bri...

Restore Trash Item using ScriptingBridge in Mac OS X via PyObjC

I'm trying to figure out a way to restore (Put Back) Trash Item using ScriptingBridge via PyObjC. There isn't enough documentation here from AppKit import NSURL from ScriptingBridge import SBApplication targetfile = NSURL.fileURLWithPath_(f.realpath) finder = SBApplication.applicationWithBundleIdentifier_("com.apple.Finder") trash_ite...

SBApplication : how to send raw data

Hello, I woudl like to send raw data (a void*) using SBApplication sendEvent Unfortunaltly I've found no documentation about this. Do you have any idea to achieve this? Thanks in advance for yoru help, Regards, ...

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 having a hard time wrapping my head around what is actually required to create a scriptable...