Hello Nobumi,
On Sun, 8 Jul 2007 11:32:52 +0900, Nobumi Iyanaga wrote:
>Why don't you use the normal 'tell application "MacPerl"' scheme?
Oh I do. In my scripting, "perl" is just an nickname for "MacPerl 5.20r4"
>Anyway, please try the script as I wrote:
Since I have a different folder structure, I did adjust it to my environment.
- - -
set my_script to "Labo:Privat:MacPerl bench:PL minitests :lsm :argv.pl"
set args to {"dog", "cat"}
set perl_arg to {}
set perl_arg to perl_arg & my_script
set perl_arg to perl_arg & args
tell application "MacPerl 5.20r4"
Do Script perl_arg mode Batch
end tell
(*in result window:
"nb args: 2
dog
cat
"
*)
== This one works too:
set my_script to "Labo:Privat:MacPerl bench:PL minitests :lsm :argv10"
set args to {"four", "five", "six"}
set perl_arg to {} & my_script & args
tell application "MacPerl 5.20r4"
Do Script perl_arg mode Batch
end tell
(*in result window:
"nb args: 3
four
five
six
"
*)
== and finally, what I was after initially:
set my_script to "Labo:Privat:MacPerl bench:PL minitests :lsm :argv10"
tell application "Finder"
set names to selection -- list of selected files
end tell
set args to {}
repeat with nam in names
set args to args & (nam as string) -- list of file names
end repeat
set perl_arg to {} & my_script & args
tell application "MacPerl 5.20r4"
Do Script perl_arg mode Batch
end tell
(*in result window:
"nb args: 3
PPC_HD:download:isoc:essais AS:isoc_06251447.zip
PPC_HD:download:isoc:essais AS:isoc_06261029.zip
PPC_HD:download:isoc:essais AS:isoc_06271306.zip
"
*)
Great. Thanks so much Nobumi. You set me on the right track.
I'm a lame duck in AppleScript.
Best regards