Page 1 of 1

Feature Request :execute cmd with the hyperlink,plz!

Posted: Mon Aug 08, 2011 6:26 am
by yyzh829
something like this:
when I click the hyperlink
C:\Program Files\AkelPad\AkelPad.exe" /Call("Scripts::Main", 1, "EvalCmd.js", "AkelPad.SetSel(42, 1000)")
in Akelpad, I want Akelpad can execute the command! I hope Akelpad can jump to the specified position with hyperlink!

Posted: Mon Aug 08, 2011 9:44 am
by cnnnc

Posted: Mon Aug 08, 2011 10:28 am
by yyzh829
thanks,but I hope just one simple click can open the hypelink or run the command!
if I click D:\test.txt#42:1000 or D:test.txt#42
akelpad return to the line i specified,that will be perfect!
btw, OpenEveryLine.js seems not working,need modify this:
WshShell.Exec(pLinesArray[nIndex]);

Posted: Mon Aug 08, 2011 10:33 am
by yyzh829
cnnnc wrote:OpenEveryLine.js
中国的!握手啊,Akelpad很好用啊!自定义快捷键是神器啊!

Posted: Mon Aug 08, 2011 8:24 pm
by FeyFre
D:\test.txt is not document URL, but UNC name, so it cannot have @fragment part.

Posted: Tue Aug 09, 2011 4:29 am
by yyzh829
FeyFre wrote:D:\test.txt is not document URL, but UNC name, so it cannot have @fragment part.
that's why i need the function!

Posted: Wed Aug 10, 2011 10:38 am
by yyzh829
URL#nSelStart:nSelEnd ,select the URL,then set this js a hotkey!

Code: Select all

var URL = AkelPad.GetSelText().match(/.+(?=#)/g);
var nSelStart = AkelPad.GetSelText().match(/([^#:](?!.*\#)(?=.*\:))+/g);
var nSelEnd= AkelPad.GetSelText().match((/([^:](?!.*\:))+/g));
AkelPad.OpenFile(URL);
AkelPad.SetSel(nSelStart, nSelEnd);

Posted: Wed Aug 10, 2011 10:42 am
by yyzh829
this is how to generate the URL:

Code: Select all

AkelPad.SetClipboardText(AkelPad.GetEditFile(0)+"#"+AkelPad.GetSelStart()+":"+AkelPad.GetSelEnd());