NEW: Command line options
Hey,
So I added in some new command line options that are fun.
* --verb-list will list all the Verb IDs and their names in Inkscape. This makes writing your own menus and hotkeys much easier as you can easily find out what the choices are.
* --verb followed by a verb ID allows you to specify a verb to be called on every document opened by Inkscape initially from the command line.
* --select followed by a node ID will allow you to add a node to the list of selected objects.
Now, initially I thought these would be really good for performance testing, and that was my driver. You could do something like this:
$ time inkscape --verb=FileClose my_complex_file.svg
And get a reasonable number.
But, now, with the selection, I think it can be much more useful than that. You can call effects, or any other verb, then FileSave and FileClose to automate all kinds of things on your diagrams.
Have fun, Ted
On Wed, 2007-02-28 at 23:30 -0800, Ted Gould wrote:
Hey,
So I added in some new command line options that are fun.
- --verb-list will list all the Verb IDs and their names in Inkscape.
This makes writing your own menus and hotkeys much easier as you can easily find out what the choices are.
- --verb followed by a verb ID allows you to specify a verb to be called
on every document opened by Inkscape initially from the command line.
- --select followed by a node ID will allow you to add a node to the
list of selected objects.
Now, initially I thought these would be really good for performance testing, and that was my driver. You could do something like this:
$ time inkscape --verb=FileClose my_complex_file.svg
And get a reasonable number.
But, now, with the selection, I think it can be much more useful than that. You can call effects, or any other verb, then FileSave and FileClose to automate all kinds of things on your diagrams.
Have fun, Ted
How can you chain them together on the commandline? That would be great to call them in order...
Jon
On Wed, 28 Feb 2007, Jon Phillips wrote:
On Wed, 2007-02-28 at 23:30 -0800, Ted Gould wrote:
So I added in some new command line options that are fun.
How can you chain them together on the commandline? That would be great to call them in order...
Of course. I think that bash limits you to about 32,000 characters on the command line though ;)
If I remember right, a bunch of the early images submitted to OCAL don't have the canvas size close to the size of the actual drawing. You should be able to use this to resize all those cavases. I'm thinking something like:
find . -iname "*.svg" | xargs -n 5 inkscape --verb=FitCanvasToDrawing --verb=FileSave --verb=FileClose
Notice the '-n 5' on xargs. Otherwise Inkscape will try and load all the documents at the same time.
--Ted
On 3/1/07, Ted Gould <ted@...11...> wrote:
On Wed, 28 Feb 2007, Jon Phillips wrote:
On Wed, 2007-02-28 at 23:30 -0800, Ted Gould wrote:
So I added in some new command line options that are fun.
How can you chain them together on the commandline? That would be great to call them in order...
Of course. I think that bash limits you to about 32,000 characters on the command line though ;)
This is incredibly cool. Thanks a lot.
However the --select option does not work for me - it complains that it cannot find the verb with this id, even though I'm trying to select an object. I see both these things are done by the same piece of code but something seems to be messed up and it mistakes object id for verb id.
When it's fixed, is it possible to use more than one --select in the same command line? For example, to write a script like: select one object, delete, select another, duplicate, deselect, select all, rotate, etc.
Also, since you changed command line interface, please don't forget to update inkscape.pod. Thanks again!
On Thu, 1 Mar 2007, bulia byak wrote:
However the --select option does not work for me - it complains that it cannot find the verb with this id, even though I'm trying to select an object. I see both these things are done by the same piece of code but something seems to be messed up and it mistakes object id for verb id.
Err, SVK messed this up :( I'm not near a computer that I can fix this and check it in. So can someone change this:
1410 new Inkscape::CmdLineAction(a, arg);
to:
new Inkscape::CmdLineAction(a == SP_ARG_VERB, arg);
That should fix it.
When it's fixed, is it possible to use more than one --select in the same command line? For example, to write a script like: select one object, delete, select another, duplicate, deselect, select all, rotate, etc.
Yes, it does that. Basically every verb and select command is put into a list, and that list is executed on every document. You can have as many select and verb commands as memory allows.
Also, since you changed command line interface, please don't forget to update inkscape.pod. Thanks again!
I will. I did forget about that.
--Ted
On 3/2/07, Ted Gould <ted@...11...> wrote:
1410 new Inkscape::CmdLineAction(a, arg);
to:
new Inkscape::CmdLineAction(a == SP_ARG_VERB, arg);
Done, works fine now.
participants (3)
-
bulia byak
-
Jon Phillips
-
Ted Gould