Applescript to parse flickr url? Change size and add page link -
what mean, if have in clipboard instance:
"http://farm6.static.flickr.com/5290/5377008438_8e3658d75f_m.jpg"
can use applescript change
"http://farm6.static.flickr.com/5290/5377008438_8e3658d75f_b.jpg"
(changing "m" "b") ?
this handy because right click/copy photo url thumbnails page without having drill down. yes, it's few clicks thumbnails page large size, can save nice.
also, copy out photo id can link main photo page?
ex:
copy "5377008438" , paste main link "http://www.flickr.com/photos/dbooster/5377008438"
i applescript because comes mind, call text expander work.
manipulating url can done this:
set baseurl "http://farm6.static.flickr.com/5290/5377008438_8e3658d75f_m.jpg" set modurl (characters 1 through -6 of baseurl text) & "b.jpg" set filename last item of (tokens of baseurl between "/") set photoid first item of (tokens of filename between "_") set mainphotopage "http://www.flickr.com/photos/dbooster/" & photoid {modurl, filename, photoid, mainphotopage} on tokens of str between delimiters set oldtids text item delimiters of applescript set text item delimiters of applescript delimiters set strtoks text items of str set text item delimiters of applescript oldtids return strtoks end tokens
when run script, get
{"http://farm6.static.flickr.com/5290/5377008438_8e3658d75f_b.jpg", "5377008438_8e3658d75f_m.jpg", "5377008438", "http://www.flickr.com/photos/dbooster/5377008438"}
i'm not clear whether need interacting clipboard. it's easy @ rate, can use get
, set
:
get clipboard set clipboard "example"
Comments
Post a Comment