

- #Shortcuts app icon how to#
- #Shortcuts app icon full#
- #Shortcuts app icon code#
- #Shortcuts app icon download#
After choosing a magic variable, you can tap on it to reveal several options for the information you can extract.
#Shortcuts app icon code#
One feature that makes them easier to use, and the resulting code easier to understand, is renaming.
#Shortcuts app icon how to#
It’s possible that I’ve finally figured out how to use Shortcuts’s magic variables. Sharp-eyed readers will notice that this shortcut includes no Set Variable steps. The Delete Photos step automatically gives the user the option to cancel the deletion, so there was no need to write any of that code. These steps are also mainly lifted from my earlier screenshot uploading shortcut.įinally, the last two steps delete the icon from Photos. The next eight steps upload the image and, if necessary, run the OptiPNG image compression command.
#Shortcuts app icon full#
Finally, the full name of the uploaded file is assembled from the date, the description, and the extension. The user is then asked to provide the description, with the default as described above. The Match and Replace regexes get rid of that stuff. Many apps, like Annotable, include descriptive bits in their name to make them easier to find. This starts by getting the app’s name and using regular expressions to extract just the part before the first colon or hyphen.

The next five steps set the name for the uploaded file. They’re taken from this shortcut I wrote a couple of months ago. The following four steps get the date strings that will be used to set the folder and the prefix of the image name. We’ll use the extension later to set the name of the uploaded image and to decide whether it’s necessary to run an image compression command.

The next three steps handle the file extension of the saved image, making it all lower case and changing “jpeg” to “jpg.” The latter is probably unnecessary, as icons are (I think) always PNGs, but better safe than sorry.
#Shortcuts app icon download#
They get the icon’s URL, download the image, mask it to round off the corners, and save it to Photos. The first five steps (not counting comments) are taken straight from Federico’s shortcut. If you want to adapt the shortcut for your own use, download it and edit away. I think I’ve reached (or maybe exceeded) the limit of shortcut length that can be comfortably displayed here. Here’s the shortcut itself, with the server information anonymized. The image is now on my blog’s server, in a folder (for the above example) named “images2018” with the name “20181121-App icon for Annotable.png.” The year in the folder name and the date prefix in the file name are handled by the shortcut. The default description is “App icon for app name,” which is what I want most of the time.ĭecide whether to delete the icon image from Photos.
