Feature Request :execute cmd with the hyperlink,plz!

English main discussion
Post Reply
  • Author
  • Message
Offline
Posts: 15
Joined: Mon Aug 08, 2011 6:20 am

Feature Request :execute cmd with the hyperlink,plz!

Post 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!
Last edited by yyzh829 on Mon Aug 08, 2011 10:30 am, edited 1 time in total.

Offline
Posts: 119
Joined: Sat Jan 12, 2008 10:16 am
Location: Shantou, China

Post by cnnnc »


Offline
Posts: 15
Joined: Mon Aug 08, 2011 6:20 am

Post 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]);

Offline
Posts: 15
Joined: Mon Aug 08, 2011 6:20 am

Post by yyzh829 »

cnnnc wrote:OpenEveryLine.js
中国的!握手啊,Akelpad很好用啊!自定义快捷键是神器啊!

Offline
Posts: 2247
Joined: Tue Aug 07, 2007 2:03 pm
Location: Vinnitsa, Ukraine

Post by FeyFre »

D:\test.txt is not document URL, but UNC name, so it cannot have @fragment part.

Offline
Posts: 15
Joined: Mon Aug 08, 2011 6:20 am

Post 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!

Offline
Posts: 15
Joined: Mon Aug 08, 2011 6:20 am

Post 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);

Offline
Posts: 15
Joined: Mon Aug 08, 2011 6:20 am

Post by yyzh829 »

this is how to generate the URL:

Code: Select all

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