Episode 20: Memo from mph!
The latest episode is up.
After some deferred fussing with Xcomic, which I was using to display the strip, I decided to just switch to MovableType, which has the benefit of cleaner archiving, the chance to write a brief note if I feel so moved, and the ability for readers to subscribe to an Atom feed if they’re so inclined. It also makes it easier to syndicate the strip over here in a sidebar item.
So … that’s about it on the Mensies front for today.
On the not-mensies-front, I have to share:
&160;&160;&160;&160;
&160;&160;&160;&160;tell application &34;System Events&34;
&160;&160;&160;&160;&160;&160;&160;&160;if ((application processes whose (name is equal to &34;firefox-bin&34;)) count) is greater than 0 then
&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;if (count of windows of application &34;Firefox&34;) is greater than 0 then
&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;
&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;tell application &34;Firefox&34;
&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;set theUrl to &171;class curl&187; of window 1
&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;set theTitle to &171;class pTit&187; of window 1
&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;end tell
&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;else
&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;return &34;Firefox is not running&34;
&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;end if
&160;&160;&160;&160;&160;&160;&160;&160;else
&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;return &34;Firefox is not running&34;
&160;&160;&160;&160;&160;&160;&160;&160;end if
&160;&160;&160;&160;end tell
&160;&160;&160;&160;
That’s the Applescript you need to get the URL in the current active window/tab of Firefox. I learned that, because my nifty snarf a story from a work site workflow wouldn’t work with Firefox due to the paucity of Applescript/Automator support.
So “firesnarf” uses that Applescript, gleaned from a chat board over at the Adium project, plus the handy-dandy cURL to grab the story and pipe it into BBEdit, where the original workflow takes over as it did before and everything is happy again. Plus I think I can reuse some of what I learned to make a Firefox-compatible version of another timesaver I wrote last year.
And with that, lunch is over. :-)