• 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: help! call jhead from automator?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help! call jhead from automator?


  • Subject: Re: help! call jhead from automator?
  • From: Josh Reiss <email@hidden>
  • Date: Wed, 21 Oct 2015 04:28:21 -0700

thank you lukas! testing it now...

one question... do I also need to echo the file names so the next part in the script gets them? (this part is only 1/2 way through the script)

On 10/21/15 4:11 AM, Lukas Rose wrote:
Hi Josh,

this task is quite easy to accomplish. You start by creating the folder action just as you described, by adding the „Filter Finder Items“, and anything else you need to filter your files. At the point where the list of files is completed (e.g. after the „Filter Finder Items“-action), you add a „Run Shell Script“-action. Remove the „cat“-thing that’s in there by default, and paste the following code into the white field:

for f in "$@"
do
    jhead -autorot $f
done

What this does is quite simple. For each file that is passed to the „Run Shell Script“-action (these are represented by $@), the shell script should do the following: Run the command „jhead -autorot“ for the current file, which is represented by $f. It will do so for each file.

For this to work you need to tell Automator how to pass the files to your script. This is done by the drop-down menu on the top right of the „Run Shell Script“-action. Change the default value „Pass input to stdin“ to „Pass input as arguments“. Then you’re done, and your Workflow should work.

Feel free to ask again if you have any questions! Have fun

Kind Regards,
Lukas

On 21.10.2015, at 11:02, Josh Reiss <email@hidden> wrote:

Hi.. total newbie to Automator here.

I'm trying to call jhead from within a folder action

basically I want to
-move all files
-call jhead command to fix rotations on all files in a folder
jhead -autorot *.jpg

-and then continue on with the next action in the automator script


so would someone be kind enough to explain to this newbie how to put this command line call in the middle of my automator script and to make sure that it runs before automator goes on to the next thing?

Or even better... is there a way if I'm working on a few images at once to have automator actually run the jhead command on the filename?
like
jhead -autorot <filename passed in from automator>


my automator script starts with "Filter Finder Items" to get all the items in the folder.

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

This email sent to
email@hidden

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

This email sent to email@hidden

References: 
 >help! call jhead from automator? (From: Josh Reiss <email@hidden>)

  • Prev by Date: Re: help! call jhead from automator?
  • Next by Date: images from "photos" to "keynote" slides
  • Previous by thread: Re: help! call jhead from automator?
  • Next by thread: images from "photos" to "keynote" slides
  • Index(es):
    • Date
    • Thread