[TxMt] Refresh FireFox command

Mats Persson mats at imediatec.co.uk
Fri Nov 5 21:19:44 UTC 2004


On Nov 5, 2004, at 19:12, Mike Chambers wrote:
> First of all, just bought my license, and want to say what a great 
> editor this has been thus far.
> Now, onto my question:
>
> I am trying to duplicate the refresh safari command to work with 
> FireFox. Here is what I have thus far:
>
> osascript -e 'tell application "FireFox" to activate'
> osascript -e 'tell application "FireFox" to do JavaScript 
> "window.location.reload();" in first document'
>
> This works, except that FireFox does not refresh the active page.
>
> Anyone have any ideas on how to get this working?
> mike c


Hi Mike & welcome to the fold.

You've helped me before on the Flash mailing list (many years ago now), 
so I thought I should help you as far as I can tonight (it's 9.30pm 
here)

The problems you are having is to do with the AppleScript syntax and 
limited AS support in Firefox.

The following Applescript works in Script Editor and just needs to be 
converted into TM working code. Don't have time to do so tonight : (

set theActiveURL to "http://www.macromedia.com/"
tell application "Firefox"
	activate
	OpenURL theActiveURL
end tell

You would use $TM_FILE_PATH to get the path to the file and load it as 
a local non-parsed file. IF you are previewing a file through a web 
server, then I guess you need to add a Project Shell Variable (info btn 
in project drawer when no file is selected) with the URL prefix and 
then use a bit of fancy footwork to add the variables together into a 
full URL.

I'll think about it over the weekend, but can't promise a solution, but 
I'm sure you - and many others - will have worked it out before then. : 
)

Hope that helped you a bit on the way.

Kind regards,

Mats




More information about the textmate mailing list