• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Passing dropped items to shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Passing dropped items to shell script
      • From: Shane Stanley <email@hidden>
References: 
 >Passing dropped items to shell script (From: Marconi <email@hidden>)
 >Re: Passing dropped items to shell script (From: Roger Howard <email@hidden>)

  • Prev by Date: Replicate command in Canvas 8
  • Next by Date: Re: Passing dropped items to shell script
  • Previous by thread: Re: Passing dropped items to shell script
  • Next by thread: Re: Passing dropped items to shell script
  • Index(es):
    • Date
    • Thread