Episode 20: Memo from mph!

January 17th, 2006  |  Published in old and busted

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:

    

    tell application "System Events"

        if ((application processes whose (name is equal to "firefox-bin")) count) is greater than 0 then

            if (count of windows of application "Firefox") is greater than 0 then

                

                tell application "Firefox"

                    set theUrl to «class curl» of window 1

                    set theTitle to «class pTit» of window 1

                end tell

            else

                return "Firefox is not running"

            end if

        else

            return "Firefox is not running"

        end if

    end tell

    

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. :-)

Leave a Response

© Michael Hall, licensed under a Creative Commons Attribution-ShareAlike 3.0 United States license.