Photo location followup

There’s always a better way to do it. Shortly after I posted my Photo Coordinates shortcut, professional automator Rosemary Orchard tweeted me a link to a cleaner shortcut that uses the Get Details of Images step.

Rosemary's improvement

As you can see, after extracting the Location property of Get Details of Images, you can further extract the Latitude and Longitude properties. This got me thinking that I could reduce the shortcut to a single step by treating the Shortcut Input magic variable as a Location, not as Photo Media, and then extracting the latitude and longitude from that.

One-step Photo Coordinates shortcut

This is a great idea, except it doesn’t work. Presumably, an image can’t be treated like a location because a location is a property of an image—and you can’t jump two levels down the hierarchy in one step.

But it does show I could have written my original shortcut more quickly by taking the Location property of the image instead of the Metadata Dictionary, and then extracting the Latitude and Longitude.

Three-step Photo Coordinates shortcut

This is no shorter than my original, but if I’d done it this way I wouldn’t have had to screw around with the nested JSON in the Metadata Dictionary. Rosemary’s is still shorter, of course, and easier to read because it doesn’t create an unnecessary variable.

On the other hand, looking into the Metadata Dictionary taught me some things about the GPS metadata in phone images that I’ve never seen in the metadata on standard cameras and that I wouldn’t have learned if I’d done it the easy way right from the start. At some point, I may make use of that. In particular, the direction the camera was pointing when the photo was taken seems like it would be nice to know in some situations.