[TxMt] View Safari source in TextMate...
Samuel DeVore
sdevore at gmail.com
Sat May 21 19:28:15 UTC 2005
So I wanted to open souce in Safari in TextMate even after javascript html
injection, if any one is interested you can add this to the scripts menu, I
pipe it through tidy though one wouldn't need to.
sam d
--start
tell application "Safari" to do JavaScript "document.body.outerHTML;" in
first document
set s to the result
set filename to random number from 1 to 10000
set the temp_file to ((path to the temporary items folder) as string) &
filename & ".html"
open for access temp_file with write permission
write s to (temp_file as alias) as string
close temp_file
set f to POSIX path of temp_file
do shell script "tidy -i '" & f & "' '" & f & "'| ~/bin/tm -a"
--end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20050521/e9339539/attachment.html>
More information about the textmate
mailing list