April 8, 2012 at 8:26 PM by Dr. Drang
I don’t know when this happened, but Flickr has added a bunch of new sizes to its photo offerings.
Since I have several scripts and TextExpander snippets that grab the URLs of Flickr photos, I needed to update them to account for the new sizes. I finally got around to doing that a couple of days ago; the results are in my flickr-stuff GitHub repository.
I’m probably not entirely done with the updates. All the parts work, and should work for the foreseeable future, but I noticed that some of the scripts and libraries use appscript, a library that acts as Python replacement for AppleScript. Unfortunately, appscript has been deprecated by its author because he can’t get Apple’s Cocoa APIs to do what he needs and the Carbon APIs have been deprecated since Snow Leopard. To better future-proof my Flickr code, I’ll have to remove the appscript functions and replace them with calls out to AppleScript via the osascript command. On my to-do list.
My most common interaction with this code is through the TextExpander snippets that grab the URLs for the various sizes of whatever Flickr photo is frontmost in my browser.1 Here are the new abbreviations and the sizes they give:
The photo above is the Medium 640 size, and its URL is
which I just generated by typing
;640. Much faster than going to the “All sizes” page, picking the size I want, and then right-clicking to copy the link to the photo.
The snippets work only for Safari and Chrome; Firefox doesn’t have an AppleScript library that can provide me with the URL of the frontmost tab. ↩