I've had several requests before to make OSA scripts accept arguments. For example, in Mac::OSA::Simple, you can do, for a saved script:
This:
But what if you want to play a specific track? You don't want to recompile your script, because that is inefficient (it can take awhile to compile an AppleScript, plus you don't want little AppleScripts all over the place).
So I mostly have it worked out that you will be able to pass arguments to your compiled AppleScript. What the code will look like, with the AppleScript:
and the Perl code:
And on the command line or whatever, you could have simply:
That's the plan, anyway. I have it working (the low-level stuff). I found a bug in Mac::OSA::OSADoEvent where the reply event was not getting filled out, so it was failing, so it will require a newer Mac::Carbon. I'll do it sometime this summer.
And yes, I know, Mac::Carbon is still slow when loading the extensions, in some cases. I'll work on that this summer, too. :-)
Now Playing: Most Likely You Go Your Way And I'll Go Mine - Bob Dylan (Biograph)