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

Sending a message in Messages with PyObjC and ScriptingBridge in Python

this is probably a simple question but I am a bit confused as I haven't found many examples online. I've been able to send messages through Messages in Mac OS using Javascript (Using this tutorial) but I can't figure out how to do it using Python…
Blark
  • 307
  • 1
  • 3
  • 15
0
votes
1 answer

in scripting bridge how can i send shortcut with 2 modifiers?

I was trying to replicate "take a screenshot shortcut" (cmd+shift+3) via cocoa and scripting bridge SystemEventsApplication * sysEvent = [SBApplication applicationWithBundleIdentifier:@"com.apple.systemevents"]; [sysEvent keyCode:20…
G3z
  • 663
  • 6
  • 19
0
votes
1 answer

ScriptingBridge --> cannot assign to property: 'self' is immutable

I am using scripting bridge to control Spotify from my osx application. I am creating an Application Object like so: var spotify: AnyObject = SBApplication(bundleIdentifier: "com.spotify.client")! then when I try to do: spotify.soundVolume = 10 I…
user3916570
  • 780
  • 1
  • 9
  • 23
0
votes
1 answer

SBApplication : how to send raw data

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,
AP.
  • 5,205
  • 7
  • 50
  • 94
0
votes
1 answer

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 =…
abhiomkar
  • 4,548
  • 7
  • 29
  • 24
0
votes
1 answer

OBJ-C : Error in opening MIcrosoft Password Protected Doc

*I need to add password in Microsoft word, pdf and ppt doc. For that i have integrated 'MicrosoftWord.h' file and used SBApplication. And used below code to open the password protected doc. self.wordApp = [SBApplication…
Nikh1414
  • 1,238
  • 2
  • 19
  • 35
0
votes
1 answer

How to use setImage in Sketch Plugins

Im currently writing a Sketch Plugin. I'm doning something like this: fill.setFillType(4); fill.setPatternImage( imageData ); fill.setPatternFillType(1); The console Outputs: setPatternImage: is deprecated. Use setImage: instead with MSImageData…
oliverwebr
  • 459
  • 3
  • 13
0
votes
1 answer

Scripting Bridge does not work(KVO,nil values)

I am currently writing an app extension for Spotify that allows me to control the playback. I am using the Spotify AppleScript API in combination with the Scripting Bridge in Objective-C. The first thing I would like to ask,does the Scripting API…
ok404
  • 352
  • 2
  • 13
0
votes
1 answer

Why [FIFinderSyncController defaultController].selectedItemURLs only give me a maximum of 10 items?

I'm making a Finder plugin but when I ask for the selected files the method only give me 10 items at most. [FIFinderSyncController defaultController].selectedItemURLs UPDATE: I got it half solved... I'm using ScriptingBridge to access Finder and get…
0
votes
1 answer

Cached iTunes Cover Art

I need to fetch cached cover art from iTunes. Currently I'm working with the scripting bridge, but it only fetches covers that are embedded in the tracks. I've also tried this method here Fetch iTunes album artwork without iTunes running but it…
user187676
0
votes
1 answer

How to perform equivalent of AppleScript "copy" command from Scripting Bridge?

Is there a way to do a remote copy within a container from Scripting Bridge? In AppleScript, this looks like "copy [element] of [container] to [location in container]". For example, in the context of a tell to a TextEdit document, you can "copy…
Walter Mundt
  • 24,753
  • 5
  • 53
  • 61
0
votes
1 answer

Cocoa Scripting Bridge to put all song names into an array

Could someone show me some code that puts all the songs names in the user's music library into an array? Then show me how to change song names to artists, albums etc.
user377419
  • 4,681
  • 13
  • 42
  • 56
0
votes
2 answers

How to safely test whether a method can be called through NSInvocation

I've generated a list of methods and properties of a class using the ObjC runtime, so that those can be called later from a bridge using NSInvocation. The problem is that for those methods that the runtime can't generate a signature I'm getting an…
rraallvv
  • 2,875
  • 6
  • 30
  • 67
0
votes
1 answer

Cocoa Scripting Bridge and element

So, the application I'm trying to script has a scripting definition file that includes a element, which is an "implicitly specified container." The question, how do I get at what's inside this element using Scripting Bridge? Or…
prater
  • 2,330
  • 1
  • 17
  • 15
0
votes
1 answer

Bridge to objc, how can it knows arguments types?

I am writing a bridge from a language I am developing and ObjC. There are several nice introspection C functions in the objective C runtime and I am able to retrieve arguments types for methods using method_getTypeEncoding. The main problem is with…
Marco
  • 783
  • 5
  • 21