On Feb 22, 2005, at 6:16 AM, Allan Odgaard wrote:
I would at least like to find a solution to get Safari and/or Firefox to refresh on save. But I think the built in tool using webkit would be coolest. Has anyone figured this out?
You may want to use Stakeout [1] for that. It can monitor a file and e.g. perform an action when the file is saved (which would be to send reload to Safari/Firefox).
[1] http://michael-mccracken.net/blog/blosxom.pl/computers/mac/ programming/meetWatch.html
Yes, Stakeout looks very cool. I also thought of using folder actions for this, but I don't know how to get Safari or Mozilla to refresh from a command line or AppleScript. Does anyone have a working example for this?
In BBEdit I used to use a script like this: Save and Refresh Safari.scpt tell application "BBEdit" save window 1 end tell
tell application "Safari" do JavaScript "location.reload()" end tell
But that stopped working with one of the updates to OS X. I would like to see an AppleScript that would check to see if the current file's URI was open in any Safari window or tab. If so bring it to the front and refresh, else open a new tab with the URI.
Any ideas? I can't be the first person to try this.