I'm trying to write an Applescript for textwrangler that will open the active document in Chrome. This is what the script looks like at the moment:
tell application "TextWrangler" to set theFile to file of document 1
tell application "Finder" to open theFile using (path to application "Google Chrome")
Let's say I an working on a file with the absolute path 'Applications/MAMP/www/index.php'. The script will open that file in the browser as 'file:// localhost/Applications/MAMP/www/index.php', showing the php code.
Instead of this I need a script that will replace 'file:// localhost/Applications/MAMP/' with 'http:// localhost/' showing the actual site.
I have tried a bunch of stuff that I found online, but I have too little experience with Applescript to achieve this.