Re: Passing dropped items to shell script
Re: Passing dropped items to shell script
- Subject: Re: Passing dropped items to shell script
- From: Marconi <email@hidden>
- Date: Fri, 15 May 2009 07:24:42 -0700
At 7:45 AM -0400 5/15/09, Mark J. Reed sent email regarding Re:
Passing dropped items to shell script:
property perlScript: quoted form of (POSIX path of (path to me) &
"Contents/Resources/perlscript.pl")
...
as Skeeve suggested, you could also construct the Perl script to
take a list of items instead of a single one,...
on open dropped_items
set commandLine to perlScript
repeat with this_item in dropped_items
set commandLine to commandLine & " " & quoted form of POSIX
path of this_item
end repeat
do shell script commandLine
end open
Mark, when I tried perlScript as a property, compiling in Script
Editor, it thought "me" was Script Editor. When run, it could not
find the bundled Perl script. (Solution?)
I incorporated multiple suggestions (Thanks for those, Roger, Shane,
Skeve and Mark.) and now have this:
on open dropped_items
set perlScript to quoted form of (POSIX path of (path to me) &
"Contents/Resources/perlscript.pl")
set commandLine to perlScript
repeat with this_item in dropped_items
set commandLine to commandLine & " " & quoted form of POSIX path
of this_item
end repeat
do shell script commandLine
end open
_______________________________________________
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