AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Question about Exec() command parameters

 
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English)
View previous topic :: View next topic  
Author Message
foliator



Joined: 13 Nov 2011
Posts: 23

PostPosted: Tue Nov 13, 2012 6:49 pm    Post subject: Question about Exec() command parameters Reply with quote

I've used a couple of dictionary programs that recognize a text string as a command line parameter. They would be very useful in conjunction with AkelPad. Is there a way to use text selected in the editing window as a parameter to be passed to the .EXE file through the Exec() command? So far, the only parameters I have found are %f, %d and %a (file, directory and AkelPad directory respectively).

Here's an example of what I had in mind:

Exec('Lookup.exe "%s"')

where %s is the selected text.
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1339
Location: Poland

PostPosted: Tue Nov 13, 2012 8:47 pm    Post subject: Reply with quote

foliator
You can do this by using the simple script:
Exec_Lookup.js
Code:
AkelPad.Exec("Lookup.exe " + AkelPad.GetSelText());


Command:
Call("Scripts::Main", 1, "Exec_Lookup.js")
Back to top
View user's profile Send private message
foliator



Joined: 13 Nov 2011
Posts: 23

PostPosted: Tue Nov 13, 2012 9:47 pm    Post subject: Reply with quote

KDJ wrote:
foliator
You can do this by using the simple script:
Exec_Lookup.js
Code:
AkelPad.Exec("Lookup.exe " + AkelPad.GetSelText());


Command:
Call("Scripts::Main", 1, "Exec_Lookup.js")

Thanks very much for that; it works flawlessly!

BTW, it didn't work at first until I used double backslashes in the external program's path, as I had noticed in some other script. By that you can probably tell that I'm no programmer. Embarassed
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group