4 March 2007 - 15:38Quick and dirty Applescript integration of GPSPhotoLinker and Google Earth

In order to geotag my photos, I used to use a homebrewed Automator workflow that used the currently selected photo in iPhoto, and opened it using GeoTagger (an applescript based app from Craig Stanton) which grabs the current coordinates of your view in Google Earth and embeds the coordinates into the EXIF info of your photos. For some reason it would take an age to launch the first time around, and was generally unreliable (the workflow that is, not Geotagger).

When geotagging photos using track logs, the only real choice is GPSPhotoLinker. I love the fact that GPSPhotoLinker also embeds city, state and country info into your photos as well as regular lat and lon coordinates, but it will only take input into photos as hand-keyed text when not using GPX track logs; i.e. there is no integration with any external mapping programs. After several weeks of hand typing coordinates out of Google Earth and into GPSPhotoLinker, I decided an Applescript was in order to do the job for me, and sorted something out last weekend which, by using UI scripting (i.e. it manipulates menu items and enters text on your behalf), grabs the current co-ordinates from Google Earth and inputs them into the ‘Manually Enter Coordinates’ dialog in GPSPhotoLinker, and then presses the Apply Button. This saves me at least 20 seconds a photo, which makes it worth it for me, and by using the Keyboard pane in System Preferences you can assign it a hot key for instant access in iPhoto.

If you are happy not embedding the extra info into your photos, and GeoTagger works for you, then I’d stick with it. Otherwise, if you were having trouble with it, want a different way of adding GPS info into your EXIF headers, or would like to add the extra data into your Photos that GPSPhotoLinker offers, then take a look at this script.

Usage:

  1. Drag the photo(s) you want to tag into GPSPhotoLinker’s Manual Mode (from iPhoto or wherever else)
  2. Find the position the photo was taken in Google Earth
  3. Make sure the photo or photos are selected in GPSPhotoLinker
  4. Run the script
  5. You’re done.

Download the script here. Credit is given to Craig Stanton to the first part of the script which gets the co-ordinates from Google Earth.

Or, the code is below if you want to integrate into your own workflow in some way:

tell application "Google Earth"
set viewInf to GetViewInfo
set coords to {latitude of viewInf, longitude of viewInf}
end tell
set long to (text item 2 of coords)
set lat to (text item 1 of coords)
activate application "GPSPhotoLinker"
tell application "System Events"
tell process "GPSPhotoLinker"
-- GUI Scripting statements:
click menu item "Manually Enter Coordinates…" of menu 1 of menu bar item "Special" of menu bar 1
set value of text field 1 of window "Manual Coordinate Entry" to lat as text
set value of text field 2 of window "Manual Coordinate Entry" to long as text
click button "Apply" of window "Manual Coordinate Entry"
end tell
end tell

No Comments | Tags: GPS, applescript, downloads, geotagging, google earth, software