Calling Perl from AppleScript
Calling Perl from AppleScript
- Subject: Calling Perl from AppleScript
- From: debt <email@hidden>
- Date: Mon, 06 Mar 2017 09:16:14 -0800
I’m trying to call a Perl script from AppleScript but I’m not having any success. I’ve written very simple test scripts but I can’t get AppleScript to actually call the Perl script. The Perl script runs fine on it’s own. I’ve included it below, as well.
Script Debugger doesn’t complain about the code. I’ve tried leaving off the var_array but that doesn’t help. I’ve tried using the full path to the Perl executable, but nothing changes. This is so simple, it’s embarrassing. I’m sure it’s something that I’m just not seeing. I’d appreciate a fresh set of eyes.
Thanks, Marc
set xxx to "1" set zzz to "2"
set var_array to xxx & " " & zzz
do shell script "perl ~/Desktop/code/AppleScript/test.pl " & var_array
——————————————
#!/usr/bin/perl
use strict; use warnings;
my ($name, $number) = @ARGV;
$name = 'x' if not $name; $number = 'z' if not $number;
open (my $fh, '>>', 'test.txt'); print {$fh} "$name\n"; print {$fh} "$number\n"; close $fh;
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden