diff --git a/openRelativeFile.js b/openRelativeFile.js index f02fd13..8f68210 100644 --- a/openRelativeFile.js +++ b/openRelativeFile.js @@ -12,6 +12,8 @@ // Usage: // Call("Scripts::Main", 1, "openRelativeFile.js") +// Also you can use -showPath argument for debug purposes: +// Call("Scripts::Main", 1, "openRelativeFile.js", "-showPath=true") //=================== //== Settings begin @@ -68,6 +70,8 @@ var optionsPath = WScript.ScriptFullName.replace(/(\.[^.]+)?$/, "-options$&"); if(new ActiveXObject("Scripting.FileSystemObject").FileExists(optionsPath)) eval(AkelPad.ReadFile(optionsPath)); +var showPath = AkelPad.GetArgValue("showPath", false); + var hMainWnd = AkelPad.GetMainWnd(); var fso = new ActiveXObject("Scripting.FileSystemObject"); var wsh = new ActiveXObject("WScript.Shell"); @@ -201,6 +205,12 @@ function openRelativePath(relPath, pathStart, pathEnd) { if(!path) return false; + if(showPath) { + path = AkelPad.InputBox(hMainWnd, WScript.ScriptName, "Path:", path); + if(!path) + return false; + } + if(pathStart && pathEnd) AkelPad.SetSel(pathStart, pathEnd); if(isFileBinary(path)) // Use system association for binary files