Sort Photos By Location And Put In Named Folders
Gets Photos' images and copies them to separate location-based iCloud Drive folders.
The shortcut searches the Photos app for the latest photos and puts them in the newly created folders on iCloud Drive at /iCloud Drive/Shortcuts/. It serves as an example of what can be done with the shortcut "Make Association List" used as a core to build this one around. Each folder is named according to the location of the photo. Existing files are overwritten. The shortcut works only with the help of "Make Association List", available to download as you're prompted to when you launch this shortcut for the first time or hadn't downloaded "Make Association List" before. In addition to the main purpose, the shortcut also shows the information about the created folders in the form of an association list – a list of key-value pairs – and copies it to Universal Clipboard making it available across your Apple devices for you to review or use it should such a necessity arise.
iCloud Drive must be enabled and have free storage.
Note. This shortcut is the new version of a shortcut named identically but is completely re-worked. However, because of the relative complexity that went into its structure, it isn't the fastest one: some decisions making an impact on its speed had to be implemented in order to overcome the shortcomings of its predecessor, such as inadvertent skips of valid images meeting the location criteria that resulted in 0 added files etc. The user can choose how many photos and what albums to search through. Make up your mind based on the performance and sophistication of your Apple device.
Warning. As of iOS 15.1 there's a bug which when using the built-in Shortcuts action to get the location the photo was taken at both as a standalone action and a parameter of a photo stored in a variable will not return the location's info: this is manifested by an action inside the shortcut raising an alert meant to check for the photos without geotags telling that "No photos with locations were found" although these photos actually may have the locations embedded. If you encounter this bug in the current or any other versions of iOS, please report it to Apple or be aware.
To test for this bug download and install the shortcut Exists Location. Select a photo you know to have location tags and run the shortcut on it: if the location is retrievable you'll see the notification banner titled "Parameter not empty" display location information, if not, the "Parameter empty" banner appears. This shortcut proceeds only with those photos that aren't screenshots; screenshots have the default behaviour to not embed location information.
Feedback is welcome.
Latest Release Notes
2.2 - Nov. 30, 2021, 9:45 a.m.
Added a loop to circumvent a false negative while checking the Shortcuts library for the existence of the "Make Association List" shortcut.