user1861458
user1861458

Reputation:

Cocoa equivalent of AppleScript 'tell application'

In AppleScript I can simply run

tell application "Spotify" to playpause

and Spotify is magically paused. But can I do that in Cocoa? I'm talking built-in Cocoa methods. Even though I could just run the AppleScript file, there has to be a more efficient way to do it.

Upvotes: 0

Views: 375

Answers (1)

rickster
rickster

Reputation: 126167

Read up on the Scripting Bridge.

Upvotes: 3

Related Questions