In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Thane Norton) wrote:

> One of my personal favorites is to use a "here document" to supply the code
> for an applescript via osascript.  i.e.

> my $script = <<'APPLESCRIPT';
> tell application "Finder"
>     display dialog "Hello World"
> end tell
> APPLESCRIPT

> local *script_to;
> local *script_from;
> local *script_error;
> my $pid = open3(*script_to, *script_from, *script_error,
>     "/usr/bin/osascript") or die "Couldn't open osascript";
> print script_to $script;
> close script_to;

A much more efficient method would be to use one of the XS AppleScript 
methods, including MacPerl::DoAppleScript() in Mac::Carbon, applescript() in 
Mac::OSA::Simple (requires Mac::Carbon), and RunAppleScript from 
Mac::AppleScript.

   my $result = DoAppleScript($script);

-- 
Chris Nandor                      [EMAIL PROTECTED]    http://pudge.net/
Open Source Development Network    [EMAIL PROTECTED]     http://osdn.com/

Reply via email to