Hi everyone!
I will like to know if its possible to run scripts throught "User Commands" and, if I can do it, how should I do it?
Thanks
Run command on Python?
Moderators: fgagnon, nikos, Site Mods
-
- Silver Member
- Posts: 244
- Joined: 2004 Jun 16, 15:09
Re: Run command on Python?
Sure. You can find full details in the User Manual beginning on page 239 (version 2.1.0-1), or under "User Commands" in the Quick Start Guide.
Basically, you want to set up a user command something like this:
$N is a token representing the filename you've selected in the active window. (There's a handy info button in the User commands properties dialog that lists all the tokens.) The quotes around the path and file names ensure that any spaces in the names are parsed correctly. If your script takes arguments, you can add the $? token, and x2 will pop up a dialog where you can enter the arguments before the script is run.
Basically, you want to set up a user command something like this:
Code: Select all
$$ "C:\Path\To\Directory\script.py" "$N"
Code: Select all
$$ "C:\Path\To\Directory\script.py" $? "$N"
Re: Run command on Python?
Thank you, you have give me the key!
But, for me Works like this:
Thank you again.
But, for me Works like this:
Code: Select all
> "C:\temp\helloworld.py"