[TxMt] Refresh FireFox command

Mats Persson mats at imediatec.co.uk
Sat Nov 6 17:14:13 UTC 2004


On Nov 6, 2004, at 00:41, Timothy Martens wrote:
> On Nov 5, 2004, at 11:59 AM, Mats Persson wrote:
>> On Nov 5, 2004, at 21:46, Mats Persson wrote:
>>> set theActiveURL to "JavaScript:window.location.reload();"
>>> tell application "Firefox"
>>> 	activate
>>> 	Get URL theActiveURL inside window 1
>>> end tell
>> So here it is in FULL working order
>> 1.	Save the above AS snippet as a AppleScript file  
>> /Library/Scripts/TextMate/Firefox-BrowserReload.scpt.  (Or whatever 
>> you like)
>> 2.	Type the following into your "Refresh in Firefox" Command:  
>> osascript /Library/Scripts/TextMate/Firefox-BrowserReload.scpt
>> That's it, it should now work just fine.
>
> I tried this and it launch Firefox but not the file preview. Instead 
> it just went to the default home page. The message in teh file I was 
> trying to preview says:
>
> /Users/tim/Library/Scripts/FirefoxReload.scpt: execution error: 
> firefox-bin got an error: Can't get 
> "JavaScript:window.location.reload();". (-1728)

Timothy,

The problem you are having has to do with the fact that you don't have 
an open page in the browser to refresh. So, just as the "Refresh in 
Safari" command, you need to load the page you are working on in the 
browser first of all, and then the command will work.

However, in the greater good of all TM users, I have created the 
following scripts/commands: (available here: 
http://wiki.macromates.com/textmate/show/Howtos )

1. Preview in Browser:  Safari, Firefox and IE5

2. Reload Browser: Safari, Firefox, IE5 and All 3 browsers.


Enjoy !

Kind regards,

Mats





More information about the textmate mailing list