Hi, sorry for the delay, now back to your request:
If not already known, AutoHotkey (AHK for short) is an scripting tool like DOS batch or VBscript or JavaScript.
An alternative is AutoIt, or KixArt at that time.
You can download it for free. There is an installer for your convenience as an zip archive too for portable use.
IT's only an 300 kB exe ( plus an MB help file and some tools)
If you are not familiar with such things download the installer (
www.AutoHotkey.com)
and install it, then you can run an *.ahk script
from everywhere without dealing with the correct path to the AutoHotkey.exe
*I* have just the autohotkey.exe in my HippoEDIT folder and launch it as shown here:
(not tested yet, but should work as expected. I hope i have think about everything?)
Example HE tool setting:
Title: you choose one
Command: %AppDir%\Tools\AutoHotkey.exe
Arguments: %AppDir%\Theno.ahk %FileName%
Init Directory: %FileDir%
Here is an AutoHotkey script for your request:
/*
For example let's say my project main folder is c:\inetpub\wwwroot
and my file's path is c:\inetpub\wwwroot\myproject\myfolder\myasp.asp
So I need the "myproject\myfolder" part as a variable as well
and the orientation of slash must be changed. "\" signs must be "/".
So my variable must return "myproject/myfolder"
Because, for me to test this file using the server on my pc I need to open this address in any browser.
http://localhost/myproject/myfolder/myasp.asp*/
;Semicolons indicates comments
; AHK parameter:
#SingleInstance, force
;//////////////////////////////////////////////////////////////////////////////////////////////////
;//Get the parameter given to THIS script by the tool from HippoEDIT
;Example:
;FileName in HippoEDIT: c:\inetpub\wwwroot\myproject\myfolder\myasp.asp
;HippoEDIT tool Arguments: path\to\your\script.ahk "%FileName%"
;TEST only:
myParameter = "c:\inetpub\wwwroot\myproject\myfolder\myasp.asp"
;remove the semicolon from next line to get the real parameter:
; myParameter = %1%
msgbox ONE: %myParameter%
;//////////////////////////////////////////////////////////////////////////////////////////////////
;////// do some modifications on that parameter
;//AHK Syntax: StringReplace, OutputVar, InputVar, SearchText [, ReplaceText, ReplaceAll?]
;// remove "c:\inetpub\wwwroot\"
StringReplace, OutputVar, myParameter, c:\inetpub\wwwroot\
msgbox TWO: %OutputVar%
;// replace "\" by "/"
StringReplace, OutputVar, OutputVar,\, /, All
;// remove the quotes
StringReplace, OutputVar, OutputVar,", , All
;// add "
http://localhost/"
OutputVar =
http://localhost/%OutputVar%msgbox THREE: %OutputVar%
;///////////////////////////////////////////////////////////////////////////////////////////////////////
;////// decide if there is an iE for reuse or launch an new instance,
;////// then put in the URL and press Enter
;//AHK Syntax: SetTitleMatchMode 2: A window's title can contain 'WinTitle' anywhere
; inside it to be a match, like here 'Windows Internet Explorer'.
SetTitleMatchMode, 2
;//AHK Syntax: IfWinExist, 'WinTitle'
IfWinExist, Windows Internet Explorer
{
;// uses Last Found Window
WinActivate
WinMaximize
Send, {F4} ;focus address bar
Sleep, 500
Send, +{Home} ;select whole last URL for overwriting
Sleep, 500
Send {DEL} ;remove explicit last URL, for correct working
Send, %OutputVar% ;paste in new URL
Send {Enter} ; press Enter-Key
return
}
;//ELSE: If no iE runs, launch it:
Run, iexplore.exe %OutputVar%
WinMaximize
return
; <EOF>