Fix a conflict between ClickToFlash and PandoraJam

Mar 27, '09 07:30:00AM

Contributed by: jporten

The ClickToFlash plug-in for Safari (recently hinted here) has an unwelcome side effect: it breaks the application PandoraJam, because PandoraJam uses WebKit and Flash to build its interaction window.

I wrote an AppleScript that works around this problem by deactivating ClickToFlash just long enough to launch PandoraJam, then reactivating ClickToFlash. Here's the code:

--PandoraJam Launcher 1.04
--Mar 10, 2009 4:08 AM   
--© Jeff Porten 2009
--Latest version here: http://www.jeffporten.com/?p=933
--Donations accepted if you find this script useful

--1.04: increased delay to 3 seconds out
--1.02: changed delay time to quarter-second in, 1 second out
--TODO: is launcher affecting thumbs up/down controls?
--TODO: is UseLauncher pref expiring?

tell application "Finder"
    --look for CTF in user folder and /Library
    set c2fLoc to false
    if exists file "ClickToFlash.plugin" of folder "Internet Plug-Ins" of (path to library folder) then
        set c2fLoc to file "ClickToFlash.plugin" of folder "Internet Plug-Ins" of (path to library folder)
    else if exists file "ClickToFlash.plugin" of folder "Internet Plug-Ins" of (path to library folder from user domain) then
        set c2fLoc to file "ClickToFlash.plugin" of folder "Internet Plug-Ins" of (path to library folder from user domain)
    end if
    
    --this might break or ask for a password when run from a non-admin account; I haven't tested this
    if c2fLoc is not false then -- a document value isn't considered "true" by AppleScript? Silly.
        set c2fHome to c2fLoc's folder
        move c2fLoc to (path to desktop folder)
        delay 0.25
        tell application "PandoraJam"
            activate
        end tell
        delay 3
        move (file "ClickToFlash.plugin" of (path to desktop folder)) to c2fHome
    end if
end tell
Use the above script in place of the PandoraJam -- run the script instead of launching PandoraJam, and it'll do the rest. (Check this post on my blog for the latest and greatest version, and some more detail on the issue.)

[robg adds: I haven't tested this one.]

Update: There's an available workaround to this problem now (as of July 2009).

Comments (2)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20090309204654998