If (" " & extensions_to_keep & " ") does not contain (" " & file_ext & " ") then set file_ext to "html" If file_base is "" then set file_base to "file" Set file_base to do shell script "echo " & quoted form of file_name & " | perl -pe 's/\\.*$//'" * Dual licensed under the MIT and GPL licenses. * Safari View Source in TextMate - v1.0. html, just add that extension into the extensions_to_keep space-delimited list.Īlso, I recommend that you bind this AppleScript to a hotkey like Cmd-U with a utility like FastScripts, for lightning-fast view-source-ability! Note: if the script is converting a file extension you wish to keep intact to. Tested with Safari 4 in OS X 10.5, but it should work pretty much anywhere.And since it tries to guess the correct filename extension to use, the correct syntax highlighter should be chosen automatically. Since it uses a temporary file to store the page source, TextMate won’t ask if you’d like to save when you close the window. This AppleScript does exactly what it says, which is allow you to view source from Safari in TextMate.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |