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: Thu, 14 May 2009 22:34:36 -0700
At 3:20 PM -0700 5/14/09, Roger Howard sent email regarding Re:
Passing dropped items to shell script:
In the future I'd recommend trying a simple debugging technique to make
sure the command string you're passing to do shell script is actually what
you expect - either use the built-in AppleScript "log" command, or throw up
a dialog with the value of that string. For instance:
display dialog "/path/to/perl/script.pl \"thepath\""
I was using display dialog to show thepath and it looked right.
FYI, this is what I have now. I added the script to the application
bundle and call it there:
on open dropped_items
repeat with i from 1 to the count of dropped_items
set this_item to (item i of dropped_items)
set thepath to POSIX path of this_item
set objectFolder to (path to me) as string
do shell script (POSIX path of objectFolder) &
"Contents/Resources/perlscript.pl " & quoted form of thepath
end repeat
end open
It works fine so, unless anyone sees a glaring problem, this is
probably complete. I'll doubtless find other uses for droplets that
pass files to shell scripts.
_______________________________________________
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