Automator and Exiftool

Discussion in 'Mac Programming' started by exa1c, Aug 15, 2015.

  1. exa1c, Aug 15, 2015
    Last edited by a moderator: Aug 16, 2015

    exa1c macrumors newbie

    Aug 15, 2015
    Hi. My intension is to write GPS data from a XMP file to and an JPG file (both file have the same name) for a number of XMP/JPS-file pairs.
    In Terminal exiftool allows me to do this using:

    exiftool -tagsfromfile Src.xmp "-all>gps:all" Dst.jpg

    To avoid doing this hundreds of times I intended to set up an automator service.
    So far I have managed to get the XMPs and JPGs stored in different variables by using two "Ask for Finder Item->Set Value to Variable" processes.
    Using "Get Value of Variable" for both variables generates a stacked variable for the following "Run Shell Script". The point I am struggling with is how to tell my exiftool command with part of the variable to use.

    My script so far is as simple as
    for f in "$@"
    exiftool -tagsfromfile "$@" "-all>gps:all" "$@"
    I know that "$@" stores a list of the paths to both the XMPs and JPGs files (this is why the above script can not work). However I am struggling to tell the exiftool which part of this list to use in the right place.

    Any advise is highly appreciated.

Share This Page