• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Calling Perl from AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Calling Perl from AppleScript
      • From: Doug McNutt <email@hidden>
    • Re: Calling Perl from AppleScript
      • From: Thomas Fischer <email@hidden>
  • Prev by Date: Re: AppleScript Versions per Iteration of OSX?
  • Next by Date: Re: collectdata
  • Previous by thread: Re: Scripting Blackboard (Learning Management System)
  • Next by thread: Re: Calling Perl from AppleScript
  • Index(es):
    • Date
    • Thread