Applescript to set Photos "Places" from a GPS data exchange (GPX) file

Nov 20, 2021
Reaction score
Here is a script I put together that will allow you load GPS locations into the the Mac Photos app from a GPS data exchange (GPX) file. (GPX is a standard XML format that contains longitude and latitude location data.) I wrote this in order to apply GPS data tracks generated on my iPhone using the very excellent "GeoTagr" app. This app has a free companion app for the Mac that allows you apply the GPS data recorded on your phone to the photo files you've downloaded from your camera. The problem with this app is that it creates "sidecar .XMP" files (for RAW, at least) that the Apple Photos app no longer recognizes when you import files into Photos. (The old iPhotos app does indeed use these files... very disappointing that Apple decided to no longer support their own format.)

So, I wrote this script in order to apply the data from the GeoTagr app after importing my pictures into Photos. To use it, just select the relevant photos in the Photos app and then run the script. You can implement this script in several ways (as a simple workflow, an application, or a service), but I recommend setting it up as a "Quick Action" service in Automator. This allows you to call the script from the "Services" menu in Photos. You just need to create a new Quick Action in Automator, add an "Run Applescript" action from the library, and then copy-and-paste in the script below. I call my own service "Set Places from GPS Tracking File".

Attached are the script (as .zip and .txt files) and a screenshot of how I set this up in Automator.


  • Set Places from GPS Tracking File.jpg
    Set Places from GPS Tracking File.jpg
    191.4 KB · Views: 90
  • Set Places from GPS Tracking
    25.4 KB · Views: 65
  • Set Places from GPS Tracking File.scpt.txt
    12.4 KB · Views: 64

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question