• 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: 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
References: 
 >Re: Passing dropped items to shell script (From: Roger Howard <email@hidden>)
 >Re: Passing dropped items to shell script (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Passing dropped items to shell script
  • 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