4 Replies Latest reply on Jul 5, 2017 2:36 PM by atj777

    Export Post-Processing not working as expected

    atj777

      I have a post-processing action that I use to create some data using Exiftool which I then use as input for another application.

       

      This used to work fine with Lightroom 5.7 on Mac OS 10.10 but stopped working after I upgraded to Mac OS 10.12.

       

      I have recently upgraded to Lightroom 6.10 to try and get it working but it still doesn't work correctly.

       

      In my Export preset I have Post-Processing set as:

      After Export: Open in Other Application

      Application: /Users/andrewtj/Desktop/diveexiftool.sh

       

      /Users/andrewtj/Desktop/diveexiftool.sh is as follows:

      for i in "$@"

      do

      /Users/andrewtj/atj.com/atj.net.au/diveexiftool.sh "$i"

      done

       

      /Users/andrewtj/atj.com/atj.net.au/diveexiftool.sh is as follows:

      F=$1

      G=${F##*/}

      rm ${F%/*}/DiveEXIF/${G%.*}.exif

      exiftool -d "%d/%m/%Y %H:%M:%S" -@ "/Users/andrewtj/atj.com/atj.net.au/exiftool.arg" -w %d/DiveEXIF/%f.exif "$1"

      open -a Preview $1

       

      If I run /Users/andrewtj/Desktop/diveexiftool.sh from Terminal with the appropriate parameters it works perfectly:

      * the old .exif files are deleted

      * new .exif files are created

      the .jpg files created in the export are displayed in Preview

       

      However, when I do the export and the Post-Processing runs /Users/andrewtj/Desktop/diveexiftool.sh I only get

      * the old .exif files are deleted

      the .jpg files created in the export are displayed in Preview

       

      exiftool does not appear to run and no .exif files are created.

       

      I can't work out why it is behaving differently.

       

      Note that the way I have it set up has some history and it was the only way I could get it working with earlier versions of Lightroom.

        • 1. Re: Export Post-Processing not working as expected
          johnrellis Most Valuable Participant

          On Mac, a post-processing action has to be a proper OS X application, not an executable or shell script. You can make such an application from your shell script using Applescript -- make a droplet that responds to files being dropped on it via the "on open" handler.  See here for a few more details: Re: Help!! Export Post process action does not fire!

           

          Alternatively, you can buy the Run Any Command plugin, which lets you run a shell command line as an export post-processing action.

           

          On Windows, it's a lot simpler -- the post-processing action just runs an executable with a command line.

          • 2. Re: Export Post-Processing not working as expected
            atj777 Level 1

            When did Adobe remove support for shell scripts in export post-processing and why did they remove it?

            • 3. Re: Export Post-Processing not working as expected
              johnrellis Most Valuable Participant

              I gave you absolutely the wrong answer. I repeated a misremembered factoid without checking, which I discovered when I went to investigate the behavior of previous versions.  Very sorry for that -- I hate it when others do this, and I hate it more when I do.

               

              I just tried this sample script action.sh as an export action, and it worked just fine after marking it executable with "chmod":

               

              #!/bin/sh
              (date; echo $1 $2; echo $PATH) >> /users/john/desktop/action.txt
              

               

              It produced this output:

               

              Wed Jul  5 13:28:22 PDT 2017
              /Users/john/Desktop/06-09-2012_SFA_SC_TWT_I00010001.tif
              /usr/bin:/bin:/usr/sbin:/sbin
              

               

              The last line points to the likely cause of the problem.  On my system, the default location that ExifTool installs itself is /usr/local/bin, which isn't on the value of PATH used by LR:

               

              Johns-MacBook-Pro-3:Desktop john$ which exiftool
              /usr/local/bin/exiftool
              

               

              So your scripts could either add the location of "exiftool" to PATH or they could just use a fully qualified pathname, e.g.

               

              #!/bin/sh
              (date; echo $1 $2; echo $PATH; /usr/local/bin/exiftool -ver) \
                  >> /users/john/desktop/action.txt
              

               

              which works correctly.

              • 4. Re: Export Post-Processing not working as expected
                atj777 Level 1

                That was the problem.  Thank you very much.

                 

                I thought it might be PATH related but a) I couldn't think why Lightroom would be using a different PATH from what I got by default in Terminal and b) couldn't think of a way of checking the PATH that Lightroom used in the Export action.