BPillRNY15

Q: Copy location from one photo to another in Photos

I am using the Photos application under OSX Yosemite, having updated to it from the older iPhoto application.

I take my pictures with both iPhone (which adds GPS or geolocation data to the images) and my D-SLR (which does not).

I like to copy the location data from the iPhone images to the D-SLR images, to provide accurate location data for all.

In iPhoto, this was easy to do, and easy to find.

How can I do something like this in Photos?

MacBook Pro (Retina, 13-inch, Late 2013), OS X Yosemite (10.10.4)

Posted on Jul 25, 2015 7:29 AM

Close

Q: Copy location from one photo to another in Photos

  • All replies
  • Helpful answers

Previous Page 2 of 3 last Next
  • by elkriverken,

    elkriverken elkriverken Oct 1, 2015 2:33 PM in response to Apple Iceman
    Level 1 (24 points)
    Apple TV
    Oct 1, 2015 2:33 PM in response to Apple Iceman

    This did it! Thanks for your help.

  • by Gerald Petiteville,

    Gerald Petiteville Gerald Petiteville Oct 4, 2015 2:57 AM in response to Apple Iceman
    Level 1 (30 points)
    Oct 4, 2015 2:57 AM in response to Apple Iceman

    This is really great, though there is a show stopper for us here in France: the script copies numbers like these to the clipboard:

    Latitude: 43,363625

    Longitude: 5,311916666667

    Altitude: altitude empty

    Whereas Photos will only accept values with a dot(.) instead of the comma(,).

     

    Is there a way to modify the script so it does the substitution?

     

    Furthermore I modified the line to have the “°” at the end of the values, but it pastes “latitude empty” to Photos. Any method to avoid this?

     

    Thank you!

  • by léonie,

    léonie léonie Oct 4, 2015 3:51 AM in response to Gerald Petiteville
    Level 10 (108,438 points)
    iCloud
    Oct 4, 2015 3:51 AM in response to Gerald Petiteville

    Gerald, instead of modifying the script you could temporarily set the system preferences > Language and region preferences to use the "." instead of the "comma", then restart the mac.

     

    but it pastes “latitude empty” to Photos

    This is an error message from the script, if it cannot read a latitude from value from the photo. Either the script encountered a timeout, or Photos could not return an EXIF value.

  • by Apple Iceman,

    Apple Iceman Apple Iceman Oct 4, 2015 6:40 AM in response to léonie
    Level 1 (34 points)
    iOS Apps
    Oct 4, 2015 6:40 AM in response to léonie

    Your script is working wonders for me. Thanks so much. However, I often get the spinning gear running continuously afterwards. I'm an Apple Script newly and have attempted to get it to work off the menu bar. Anything that I may have done wrong? I changed the clipboard data, which works better.

     

    on ensure_val(the_value, default_value)

      -- if the_value is defined return the value, otherwise the default value

      if the_value is equal to "missing value" then

      return default_value

      else

      return the_value

      end if

    end ensure_val

     

    -- on run {}

    tell application "Photos"

      activate

     

      set imageSel to (get selection) -- get the selected image

     

      if imageSel is {} then

      error "Please select an image."

      end if

      tell the first item of imageSel

      set loc to get the location --retrieve longitude and latitude as list

      set lati to (the first item of loc) as string

      set longi to (the second item of loc) as string

      set alti to get the altitude as string -- retrieve the altitude

      end tell

     

    end tell

     

     

    -- check for undefined values

    set lati to ensure_val(lati, "latitude empty")

    set longi to ensure_val(longi, "longitude empty")

    set alti to ensure_val(alti, "altitude empty")

     

     

    -- display the result in a dialog panel

    set panel_message to "Latitude: " & lati & "

    Longitude: " & longi & "

    Altitude: " & alti & "

     

    Copied to the clipboard"

    display dialog panel_message buttons ¬

      "OK" with icon caution default button "OK"

     

     

    -- copy the GPS data to the clipboard

    set clipboard_message to lati & "° " & longi & "°"

    set the clipboard to clipboard_message

     

     

    return clipboard_message

     

     

    -- end run

  • by Gerald Petiteville,

    Gerald Petiteville Gerald Petiteville Oct 4, 2015 11:59 AM in response to léonie
    Level 1 (30 points)
    Oct 4, 2015 11:59 AM in response to léonie

    Thank you for this advice, though it’s not a solution I’d use as I only have random and seldom photos to modify.

    Do you think the modification could be scriptable? As well as for the “empty latitude” problem, is there a way to filter out an empty result in the script?

     

    Again, thank you!

  • by cygnl7,

    cygnl7 cygnl7 Nov 6, 2015 7:56 AM in response to BPillRNY15
    Level 1 (4 points)
    Nov 6, 2015 7:56 AM in response to BPillRNY15

    This looks great!

     

    I have opted for a different approach using Automator and a service. This service opens the selected photo's location in the Apple Maps app and displays the latitude and longitude which can then be directly copied and pasted to other images in Photos as described above.

     

    What I did:

    • Open Automator
    • File -> New
    • Select "Service"
    • Choose "no input" for "Service receives" in "Photos"
    • Add "Get Selected Photos Items" from the actions list
    • Add "Show Location in Maps" from the actions list below the first (and feel free to adjust the display options)
    • Save this with a useful name (I called mine "Photos to Map")

     

    Here's what it looks like when I'm done:

    Screen Shot 2015-11-06 at 8.53.00 AM.png

     

    For other details see https://photosautomation.com/maps-action.html

     

    Now all I have to do is select a photo with the location info I want, go to the Photos menu -> Services -> Photos to Map, and copy the lat/lon from Maps. Then back in Photos I select the photos to which I wish to apply the location information, cmd-I (to bring up the info), and paste the lat/lon where it says "Assign a location."

  • by léonie,

    léonie léonie Nov 6, 2015 8:11 AM in response to Apple Iceman
    Level 10 (108,438 points)
    iCloud
    Nov 6, 2015 8:11 AM in response to Apple Iceman

    Sorry, I missed your question.

     

    If you are still interested, this line is causing the spinning wheel:

    display dialog panel_message buttons ¬

      "OK" with icon caution default button "OK"


    the wheel will spin, while the script is waiting for the "OK" button to be pressed. You may want to make these lines the last action of the script.  Move it directly before the "return" line.

  • by léonie,

    léonie léonie Nov 6, 2015 8:38 AM in response to cygnl7
    Level 10 (108,438 points)
    iCloud
    Nov 6, 2015 8:38 AM in response to cygnl7

    I have opted for a different approach using Automator and a service.

    Yes, the "Show Location in Maps" action is very promising.  Only the implementation of this action is a bit buggy.

     

    It does not work well with language and region settings for countries that are using a decimal comma instead of a decimal point.  I have my language &region settings (in System Preferences > Language&Region> Advanced)  set to the german number format with a decimal comma.

     

    Photos will send the GPS coordinates to the Maps.app with a comma and not decimal point. The Map will not understand these coordinates and I have to edit the GPS manually to be able to see the places pin.

     

     

    Screen Shot 2015-11-06 at 17.25.10GMT.png

     

    Once I edit the coordinates and change the decimal commas to decimal points, I can copy and past the coordinates directly into the Info panel in Photos.

     

    It is a bit silly that Photos is sending a localized GPS coordinate format to Maps, if neither Photos nor Maps do understand it.  Photos needs the decimal point format as well.

    Once edited, the GPS coordinates will work well.

    Screen Shot 2015-11-06 at 17.32.36GMT.png

  • by cygnl7,

    cygnl7 cygnl7 Nov 6, 2015 9:15 AM in response to léonie
    Level 1 (4 points)
    Nov 6, 2015 9:15 AM in response to léonie

    That is pretty lame. Definitely a bug.

  • by léonie,

    léonie léonie Nov 6, 2015 9:20 AM in response to cygnl7
    Level 10 (108,438 points)
    iCloud
    Nov 6, 2015 9:20 AM in response to cygnl7

    cygnl7 wrote:

     

    That is pretty lame. Definitely a bug.

    But on the plus side, it is great that there are now Automator actions for Photos at all.  There is hope!

  • by Lost in Asia,

    Lost in Asia Lost in Asia Jul 25, 2016 6:47 AM in response to léonie
    Level 3 (631 points)
    Apple Music
    Jul 25, 2016 6:47 AM in response to léonie

    Bump: is there an easier way to do this yet? I just want to copy location from one photo, and then paste to another, without jumping into Google and extracting GPS data. Any word about upcoming changes in Sierra?

  • by léonie,

    léonie léonie Jul 25, 2016 7:15 AM in response to Lost in Asia
    Level 10 (108,438 points)
    iCloud
    Jul 25, 2016 7:15 AM in response to Lost in Asia

    This important feature has not even mentioned during the keynote presentation of Sierra at all, so I donot expect too much in that direction.

  • by Lost in Asia,

    Lost in Asia Lost in Asia Jul 25, 2016 4:28 PM in response to léonie
    Level 3 (631 points)
    Apple Music
    Jul 25, 2016 4:28 PM in response to léonie

    OK, thanks léonie! I was hoping I'd missed something and that there was either a new feature (or rather, the return of when I happily used in iPhoto for many years!), or something upcoming in Sierra, but I guess not.

  • by léonie,

    léonie léonie Jul 25, 2016 4:53 PM in response to Lost in Asia
    Level 10 (108,438 points)
    iCloud
    Jul 25, 2016 4:53 PM in response to Lost in Asia

    I hope, we will be pleasantly surprised.

  • by burdell2,

    burdell2 burdell2 Jul 31, 2016 7:32 AM in response to léonie
    Level 1 (13 points)
    Apple TV
    Jul 31, 2016 7:32 AM in response to léonie

    has anyone found an easier way to do this? I wonder if it will be easier with MacOS Sierra?

Previous Page 2 of 3 last Next