Re: AS driving Perl (or vice-versa)
Re: AS driving Perl (or vice-versa)
- Subject: Re: AS driving Perl (or vice-versa)
- From: "Gary (Lists)" <email@hidden>
- Date: Sun, 17 Jul 2005 00:41:25 -0400
"Jim Witte" wrote:
> Since there's the thread "AS driving Perl", I though I'd ask a
> question I've had for a couple of days - is there an environment for
> doing Perl/AS (or Perl/OSA) scripting *easily*?
'osascript' [See below for a linked article re:Perl and AS]
> I know I can run
> Perl through terminal, but I'm thinking of an environment where I
> could write something like
>
> my %buttonSet= {"OK", "Cancel"}
> display dialog "Enter file name:" default answer "a file" buttons %
> buttonSet
Languages must have a 'context' in which to be understood, and all that.
Dictionaries, interpreters, translators, sifters, shifters, sorters and
such.
If this is supposed to be AppleScript, '%' will not cut the mustard. I know
you know that, but where would you propose this 'mixed language' be
executed? By whose rules?
And is this next bit Perl or PHP? Is it both, and therefore, neither?
> FD = open($fname, r+)
> $i = 1
Whorf, Wittgenstein, Levenshtein be damned, eh? ;)
La tâche - el revolver - of - Sprachkonstruierens - is a - guasto -
extrémité.
> You get the idea.
Yes, but I'm not a fan. ;)
> Does anything like this even remotely exist? Or even just a way
> to run OSA commands from within Perl?
'osascript' exists, and so "blending" languages into a muddy mix is not
required at all (well, it's enough of a muddy mix already, I suppose is the
point.) (And I know you said 'easy'.)
For a very useful explanation of running AppleScript in Perl, here's an
article which describes a Perl routine like this:
# Subroutine to actually run a bit of AppleScript.
sub AppleScript {
my($script) = shift @_;
print "$script\n";
system(qq|/usr/bin/osascript -e '$script'|);
}
<http://www.bradrice.com/wposx/?p=42>
--
Gary
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden