Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

pudge (1)

pudge
  (email not shown publicly)
http://pudge.net/
AOL IM: Crimethnk (Add Buddy, Send Message)

I run this joint, see?

Journal of pudge (1)

Thursday June 05, 2003
08:43 PM

Calling AppleScripts With Arguments

[ #12646 ]

This works now (in my local code, I won't release it for a couple of weeks probably):

use Mac::OSA::Simple;
 
my $script = compile_applescript(<<"EOS");
on \xC7event abcd1234\xC8 (trackname, foo)
    tell application "iTunes"
        play (first track of library playlist 1 whose name is trackname)
        return [artist of current track, foo]
    end tell
end \xC7event abcd1234\xC8
EOS
 
print join "|", $script->call('abcd', '1234', ["I Hung My Head", "garble!"]);

Of course, you could load a compiled AppleScript from disk instead of compiling one in memory, but it is easier to demonstrate it like this.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.