[TxMt] Web preview is a cool idea but useless?

Bruno Bronosky BrunosJunk at Bronosky.com
Tue Feb 22 21:43:37 UTC 2005


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1931 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20050222/fd8c7a62/attachment.bin>


More information about the textmate mailing list