So, if you want to define a trigger on a button press that toggles iTunes play/pause, you can just type “iTunesPlayPause()” into the Embedded: field in the Actions: tab (or an Action Group) when the Type: is Execute AppleScript. This is an attachment script: it defines a bunch of handlers that allow Indigo to talk to and control to iTunes. So, for instance, we include a script called “iTunes attachment.scpt”. AppleScript functions, called handlers, can be defined as standalone functions that are available to any script that's talking to Indigo. Next, let's talk a little about attachment scripts. Using AppleScript, you can solve problems in ways that we've never considered. Why? Because we'll never be able to anticipate your every need, nor should we even try. So, you can use scripts to create objects, get/set object properties and delete objects, control objects (turn lights on/off, enable/disable triggers and time/date actions), etc. And, what's not there will most likely be added as soon as we hear someone needs that functionality. One look at the AppleScript dictionary and you'll see pretty much everything is there. Almost everything you can do in the Mac client UI can be done through AppleScript. That will be the target of your tell statements. Because Indigo is a client/server application, you won't be scripting the client - rather, you'll be scripting the Indigo server application, called appropriately enough “IndigoServer”. If you're new to AppleScript, some of the descriptions below may be foreign to you, but we've tried to make this description as high-level as possible while offering the information thats necessary to start scripting Indigo Pro.įirst, let's talk about scripting Indigo Pro. It's a very good overview and reference in one book. If you're interested in learning more about AppleScript, we'd suggest AppleScript: The Definitive Guide, 2nd Edition by Matt Neuburg. So, allowing Indigo Pro to be scripted via AppleScript (Mac OS X's native scripting language), allowing Indigo Pro to be extended via attachment scripts, and allowing Indigo Pro to execute AppleScripts gives users the ability to fill in functionality that they need for their particular environment. However, because we're just the software that glues all of these hardware devices (and, in fact, other software) together, it's impossible for us to support every device, every protocol, natively and in a timely manner. Indigo has a very rich set of functionality: flexible scheduling and triggering, broad device support, an excellent UI abstraction (if we do say so ourselves). If you need to communicate with other Mac applications then AppleScript is probably still the best way to go. While all of the information in this article still applies to Indigo 5 and beyond, if you're new to Indigo we recommend learning Python Scripting instead as it is more full-featured - see the Python Scripting Tutorial for more information. Note: This article was written before Indigo 5 so there is no mention of Python Scripting. The rest of this article is left here for users of Indigo 7.3 and earlier. The best place to start is with the Indigo and Python wiki page. To write scripts that interact with Indigo objects, you must use Python. Update: AppleScript that targets the Indigo Server ( tell IndigoServer) is no longer supported in Indigo 7.4 and beyond.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |