Script and Droplet for forcing an app to run with the old WebKit

Friday, July 20th, 2007 @ 7:26 pm | Mac, Scripting

Thomas Aylott over at subtleGradient had a posting a little while ago about how to install Safari 2 on top of Safari 3 beta and open applications with the older version of WebKit. I was needing to do this a lot and his work around called for running a command from the shell every time. I thought wouldn’t it be nice to to have some quick way to do this from the finder. Also, some apps were spitting out some text to standard error in the terminal and while the “&” at the end prevented standard output from going to the terminal (by making the command run in the background), standard error was stilling being displayed. So, I wrote a bash script and turned it into a droplet with Platapus. I then created a Automator workflow that opened a selected finder item with the droplet, and saved it as Finder plug-in, which allows me to call it from a contextual menu in the Finder. Of course you can always add the app to the dock or use Quicksilver triggers or whatever you prefer at that point.

I’ve included the script code below and posted the app and workflow with this posting (to use them you will have to first follow the instructions over at subtleGradient to install Safari 2 on top of Safari 3).
(*the workflow should be installed in “~/Library/Workflows/Applications/Finder“)

#!/usr/bin/env bash

IFS=" "
filename=${*##/*/}
appname=${filename%%.*}
binpath="$*/Contents/MacOS/$appname"

env DYLD_FRAMEWORK_PATH="/Applications/Safari2.app/Contents/Resources" \
WEBKIT_UNSET_DYLD_FRAMEWORK_PATH=YES "$binpath" >&/dev/null &

Tags: , , , , , ,

One Response to “Script and Droplet for forcing an app to run with the old WebKit”

  1. Thomas Aylott Says:

    Michel Fortin has released Multi-Safari. Now you can just download a standalone version of every Safari version evar!

    http://subtlegradient.com/articles/2007/10/10/multiple-standalone-safaris

    Thanks for the link :D

Leave a Reply