Re: Calling an Applescript from a Perl Script
Re: Calling an Applescript from a Perl Script
- Subject: Re: Calling an Applescript from a Perl Script
- From: Christopher Nebel <email@hidden>
- Date: Mon, 30 Jun 2003 17:21:53 -0700
On Monday, June 30, 2003, at 12:01 PM, Jean-Baptiste LE STANG wrote:
I'm trying to use perl to call an AppleScript but I'd like to be able
to get the result of the applescript in my Perl script because I'll
need to return the result later, and I owuld like also that the perl
script wait until the Applescript has finished its work. Has anyone
done such a thing and could help me?
osascript(1) will do what you need -- it prints the result of the
script. To use it from Perl, use backticks or qx//, which (by default)
will wait until the command finishes. For example:
#!/usr/bin/perl
$x = `osascript -e '"hello " & "world."'`;
print $x;
--> hello world.
Someone has probably written a Perl package that can invoke an OSA
script directly, but this works with a stock system.
--Chris Nebel
Apple Development Tools
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.