Skip to content

Instantly share code, notes, and snippets.

@troutcolor
Last active October 22, 2015 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save troutcolor/75edebf090305b1d70c1 to your computer and use it in GitHub Desktop.
Save troutcolor/75edebf090305b1d70c1 to your computer and use it in GitHub Desktop.
Apple Script to find where a flickr photo (or photos) selected in the finder comes from. See http://cogdogblog.com/2015/10/21/flickr-trickr/ I use FastScripts to run this sort of thing.
tell application "Finder"
set files_ to selection
repeat with file_ in files_
set imgkind to (kind of file_)
repeat 1 times
set imgkind to (kind of file_)
if (imgkind does not contain "Image") then
exit repeat -- 1 times
end if
set filename to name of file_
set AppleScript's text item delimiters to {"_"}
set theid to first text item of filename as string
do shell script ("open http://flickr.com/photo.gne?id=" & theid)
get theid
end repeat
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment