• 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: Do Shell Script Bug (or feature)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do Shell Script Bug (or feature)


  • Subject: Re: Do Shell Script Bug (or feature)
  • From: Christopher Nebel <email@hidden>
  • Date: Fri, 1 Jul 2005 13:26:37 -0700

On Jul 1, 2005, at 12:44 PM, Chris Norman wrote:

on process_item(this_item)
do shell script "/opt/local/bin/jhead -cmd \"/opt/local/bin/ jpegtran
-progressive &i &o \" -autorot -n%m-%d-%Y-%H-%M-%S " & this_item
end process_item


So you will see that the jhead tool is not like other command line tools
that pipe to other tools, and instead uses the -cmd argument to call onto
jpegtran to do it's thing (which is the -autorot argument) and I am also
having jhead rename the files according the their EXIF date and time.


So when this script runs, it always tells me that the jpegtran command can
not be found. I thought it might be something to do just with how AS was
sending the command line to the system, so I created a shell script that I
saved, and then called just the shell script, but got the same error. But
when I run the same exact command from the terminal, things work.

If you plan to be spending a lot of time using "do shell script", then you should read TN2065, "do shell script in AppleScript" <http:// developer.apple.com/technotes/tn2002/tn2065.html>.


Assuming that /opt/local/bin/jpegtran exists, then this is probably some sort of quoting bug. The placement of those internal double quotes looks a bit fishy to me, especially since you say that the "- autorot" is supposed to be an argument to jpegtran. Exactly what do you say in Terminal that works?


--Chris Nebel AppleScript and Automator Engineering

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Do Shell Script Bug (or feature)
      • From: Chris Norman <email@hidden>
References: 
 >Do Shell Script Bug (or feature) (From: Chris Norman <email@hidden>)

  • Prev by Date: Testing to see if a string is a valid path
  • Next by Date: Re: path to as string
  • Previous by thread: Do Shell Script Bug (or feature)
  • Next by thread: Re: Do Shell Script Bug (or feature)
  • Index(es):
    • Date
    • Thread