Hi FDP,
> Now I just have to figure out how to take a modifier for the command (e.g. fork at --num or ++num).
It is possible to pass parameters to a command so that you can have 2 different keyboard shortcuts each of which call the same command but with slightly different behavior.
The Nudge plug-ins do this so they're the best ones to look at for an example:
http://kyticka.webzdarma.cz/3d/moi/#Nudge
You basically put the parameter as a second word in the keyboard shortcut, with a space after the command name, like:
IncrementImage backward
Then inside the command script file, use moi.command.getCommandLineParams() to access those parameters.
Something like this example from the Nudge command:
code:
var params = moi.command.getCommandLineParams();
if ( params.search( /left/i ) != -1 )
{
// The parameters contain the word "left" in it.
dist = -dist;
}
- Michael
|