At 23:44 +0900 2004.02.17, Iyanaga Nobumi wrote:
>As the subject line says, I would like to ask you if it is impossible
>to call "do shell script" from MacPerl, using
>MacPerl::DoAppleScript($script).
>
>I tried:
>
>$script = <<EOS;
>do shell script "cd ~/; ls"
>EOS

I am not sure what that would even mean.  :)  There's no shell on Mac OS,
and no "do shell script" event on Mac OS.  It's only for Mac OS X, where a
shell exists.


If you really are on Mac OS X, and just calling the MacPerl module from Mac
OS X, then that should work:

[EMAIL PROTECTED] pudge]$ perl -MMacPerl=DoAppleScript -le 'print
   DoAppleScript(q{do shell script "cd ~/; ls"})' | mcat

"Applications
Desktop
Documents
Games
Library
MacOS
Movies
Music
No Backup
Pictures
Public
Sites
bin
down
src
tmp"

(mcat is a command-line script I have to convert Mac newlines, such as
AppleScript returns here, to Unix newlines.)

Of course, if this were really on Mac OS X, you should just use backticks
anyway:

[EMAIL PROTECTED] pudge]$ perl -le 'print `cd ~/; ls`'
Applications
Desktop
Documents
Games
Library
MacOS
Movies
Music
No Backup
Pictures
Public
Sites
bin
down
src
tmp


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

Reply via email to