https://wiki.inkscape.org/wiki/api.php?action=feedcontributions&user=Dmitryz&feedformat=atomInkscape Wiki - User contributions [en]2024-03-29T12:29:34ZUser contributionsMediaWiki 1.36.1https://wiki.inkscape.org/wiki/index.php?title=Using_xverbs&diff=105226Using xverbs2017-05-18T00:22:15Z<p>Dmitryz: fixed naming consistency</p>
<hr />
<div><br />
== Overview ==<br />
<br />
"xverbs" is an extension that is useful for some batching tasks. It is available [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/main-cmdlinexact.cpp in Inkscape trunk], and will be available in the stable 0.93 release. <br />
<br />
Inkscape has a set of action "verbs", which is bounded to the menu system. One of the interesting uses of "verbs" is the --verb command line option. But the length of command line is limited and "verbs" can be applied for only one .svg file or for an empty new document.<br />
<br />
"xverbs" aims to overcome the limit of MAX_PATH (with libyaml) and add some useful "xverbs" with arguments. For example "xverb-id: XFileOpen, some.svg" allows you to open an existing document and "xverb-id: XFileSaveAs, other.svg" to save it with specified name.<br />
<br />
== Usage ==<br />
<br />
<br />
inkscape --xverbs=xverbs.yaml<br />
<br />
'''Format of xverbs.yaml:'''<br />
<br />
<pre><br />
# only "verbose: yes" enable logging<br />
verbose: yes<br />
<br />
run:<br />
# open document to process<br />
- xverb-id: XFileOpen, gfx_sources/loading_screen/sandclock_atlas.svg<br />
<br />
# set label for XUndoToLabel "xverb" works<br />
# NB: if undo labels do not work, use "verb" EditUndo instead of XUndoLabel and XUndoToLabel<br />
- xverb-id: XUndoLabel, fresh_document<br />
<br />
# select element to handle<br />
- xverb-id: XSelectElement, top_sand<br />
<br />
# common "verbs"<br />
- verb-id: EditInvertInAllLayers<br />
- verb-id: EditDelete<br />
- verb-id: FitCanvasToDrawing<br />
<br />
# save element to separate svg document<br />
- xverb-id: XFileSaveAs, output/thegame/linux/data/gfx/loading_screen/top_sand.svg<br />
<br />
# also save png preview<br />
- xverb-id: XFileExportPNG, output/thegame/linux/data/gfx_preview/loading_screen/top_sand.png<br />
<br />
# return to the fresh_state of document<br />
- xverb-id: XUndoToLabel, fresh_document<br />
<br />
# do any other handling<br />
# Inkscape has a lot of useful "verbs"<br />
- verb-id: FileQuit<br />
</pre><br />
<br />
<br />
== List of verbs ==<br />
<br />
<br />
"verbs" are developed for the Inkscape menu system, so "verbs" do not have any arguments. A list of available Inkscape "verbs" can be found in the source code:<br /><br />
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/verbs.cpp#L2543<br />
<br />
<br />
== List of xverbs ==<br />
<br />
XFileSaveAs - save current document to specified filename<br /><br />
XFileOpen - open specified .svg filename instead of current document<br /><br />
XFileExportPNG - export to specified .png filename<br /><br />
XSelectElement - select svg element by name<br /><br />
XUndoLabel - set undo label<br /><br />
XUndoToLabel - undo to specified label<br /><br />
<br />
== Additional info ==<br />
<br />
Some additional info can be found in this mailing list thread: <br /><br />
https://sourceforge.net/p/inkscape/mailman/inkscape-devel/thread/33487d06-e3c1-a4e5-1496-7b370d672d2f%40gmail.com/#msg35392523</div>Dmitryzhttps://wiki.inkscape.org/wiki/index.php?title=Using_xverbs&diff=105211Using xverbs2017-05-16T15:27:12Z<p>Dmitryz: add overview section</p>
<hr />
<div><br />
== Overview ==<br />
<br />
"xverbs" is an extension that is useful for some batching tasks. Inkscape have a set of actions "verbs", which is bounded to menu system. One of the interesting using of "verbs" is the --verb command line option. But the length of command line is limited and "verbs" can be applied for only one .svg file or for empty new document.<br />
<br />
"xverbs" aims to overcome limit of MAX_PATH (with libyaml) and add some useful "xverbs" with arguments. For example "xverb-id: XFileOpen, some.svg" allow open existed document and "xverb-id: XFileSaveAs, other.svg" save it with specified name.<br />
<br />
== Using ==<br />
<br />
<br />
inkscape --xverbs=xverbs.yaml<br />
<br />
'''Format of xverbs.yaml:'''<br />
<br />
<pre><br />
# only "verbose: yes" enable logging<br />
verbose: yes<br />
<br />
run:<br />
# open document to process<br />
- xverb-id: XFileOpen, gfx_sources/loading_screen/sandclock_atlas.svg<br />
<br />
# set label for XUndoToLabel "xverb" works<br />
# NB: if something wrong with undo labels use "verb" EditUndo instead of XUndoLabel and XUndoToLabel at all<br />
- xverb-id: XUndoLabel, fresh_document<br />
<br />
# select element to handle<br />
- xverb-id: XSelectElement, top_sand<br />
<br />
# usual "verbs"<br />
- verb-id: EditInvertInAllLayers<br />
- verb-id: EditDelete<br />
- verb-id: FitCanvasToDrawing<br />
<br />
# save element to separated svg document<br />
- xverb-id: XFileSaveAs, output/thegame/linux/data/gfx/loading_screen/top_sand.svg<br />
<br />
# also save png preview<br />
- xverb-id: XFileExportPNG, output/thegame/linux/data/gfx_preview/loading_screen/top_sand.png<br />
<br />
# return to the fresh_state of document<br />
- xverb-id: XUndoToLabel, fresh_document<br />
<br />
# do any other handling<br />
# Inkscape have a lot of useful "verbs"<br />
- verb-id: FileQuit<br />
</pre><br />
<br />
<br />
== List of verbs ==<br />
<br />
<br />
"verbs" is developed for Inkscape menu system, so "verbs" does not have any arguments. List of Inkscape "verbs" can be found at source code:<br /><br />
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/verbs.cpp#L2543<br />
<br />
<br />
== List of xverbs ==<br />
<br />
XFileSaveAs - save current document to specified filename<br /><br />
XFileOpen - open specified .svg filename instead of current document<br /><br />
XFileExportPNG - export to specified .png filename<br /><br />
XSelectElement - select svg element by name<br /><br />
XUndoLabel - set undo label<br /><br />
UndoToLabel - undo to specified label<br /><br />
<br />
<br />
== Additional info ==<br />
<br />
Some additional info can be found at maillist thread: <br /><br />
https://sourceforge.net/p/inkscape/mailman/inkscape-devel/thread/33487d06-e3c1-a4e5-1496-7b370d672d2f%40gmail.com/#msg35392523</div>Dmitryzhttps://wiki.inkscape.org/wiki/index.php?title=Using_xverbs&diff=105206Using xverbs2017-05-16T14:29:21Z<p>Dmitryz: fix xverbs format</p>
<hr />
<div><br />
== Using ==<br />
<br />
<br />
inkscape --xverbs=xverbs.yaml<br />
<br />
'''Format of xverbs.yaml:'''<br />
<br />
<pre><br />
# only "verbose: yes" enable logging<br />
verbose: yes<br />
<br />
run:<br />
# open document to process<br />
- xverb-id: XFileOpen, gfx_sources/loading_screen/sandclock_atlas.svg<br />
<br />
# set label for XUndoToLabel "xverb" works<br />
# NB: if something wrong with undo labels use "verb" EditUndo instead of XUndoLabel and XUndoToLabel at all<br />
- xverb-id: XUndoLabel, fresh_document<br />
<br />
# select element to handle<br />
- xverb-id: XSelectElement, top_sand<br />
<br />
# usual "verbs"<br />
- verb-id: EditInvertInAllLayers<br />
- verb-id: EditDelete<br />
- verb-id: FitCanvasToDrawing<br />
<br />
# save element to separated svg document<br />
- xverb-id: XFileSaveAs, output/thegame/linux/data/gfx/loading_screen/top_sand.svg<br />
<br />
# also save png preview<br />
- xverb-id: XFileExportPNG, output/thegame/linux/data/gfx_preview/loading_screen/top_sand.png<br />
<br />
# return to the fresh_state of document<br />
- xverb-id: XUndoToLabel, fresh_document<br />
<br />
# do any other handling<br />
# Inkscape have a lot of useful "verbs"<br />
- verb-id: FileQuit<br />
</pre><br />
<br />
<br />
== List of verbs ==<br />
<br />
<br />
"verbs" is developed for Inkscape menu system, so "verbs" does not have any arguments. List of Inkscape "verbs" can be found at source code:<br /><br />
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/verbs.cpp#L2543<br />
<br />
<br />
== List of xverbs ==<br />
<br />
XFileSaveAs - save current document to specified filename<br /><br />
XFileOpen - open specified .svg filename instead of current document<br /><br />
XFileExportPNG - export to specified .png filename<br /><br />
XSelectElement - select svg element by name<br /><br />
XUndoLabel - set undo label<br /><br />
UndoToLabel - undo to specified label<br /><br />
<br />
<br />
== Additional info ==<br />
<br />
Some additional info can be found at maillist thread: <br /><br />
https://sourceforge.net/p/inkscape/mailman/inkscape-devel/thread/33487d06-e3c1-a4e5-1496-7b370d672d2f%40gmail.com/#msg35392523</div>Dmitryzhttps://wiki.inkscape.org/wiki/index.php?title=Using_xverbs&diff=105201Using xverbs2017-05-16T13:28:10Z<p>Dmitryz: add formating and verbs list info</p>
<hr />
<div><br />
== Using ==<br />
<br />
<br />
inkscape --xverbs=xverbs.yaml<br />
<br />
'''Format of xverbs.yaml:'''<br />
<br />
<pre><br />
# only "verbose: yes" enable logging<br />
verbose: yes<br />
<br />
run:<br />
# open document to process<br />
- xverb-id: XFileOpen, gfx_sources/loading_screen/sandclock_atlas.svg<br />
<br />
# set label for XUndoToLabel "xverb" works<br />
# NB: if something wrong with undo labels use "verb" EditUndo instead of XUndoLabel and XUndoToLabel at all<br />
- xverb-id: XUndoLabel, fresh_document<br />
<br />
# select element to handle<br />
- xverb-id: XSelectElement, top_sand<br />
<br />
# usual "verbs"<br />
- verb-id: EditInvertInAllLayers<br />
- verb-id: EditDelete<br />
- verb-id: FitCanvasToDrawing<br />
<br />
# save element to separated svg document<br />
- xverb-id: XFileSaveAs, output/thegame/linux/data/gfx/loading_screen/top_sand.svg<br />
<br />
# also save png preview<br />
- xverb-id: XFileExportPNG, output/thegame/linux/data/gfx_preview/loading_screen/top_sand.png<br />
<br />
# return to the fresh_state of document<br />
- xverb-id: XUndoToLabel, fresh_document<br />
<br />
# do any other handling<br />
# Inkscape have a lot of useful "verbs"<br />
- verb-id: FileQuit<br />
</pre><br />
<br />
<br />
== List of verbs ==<br />
<br />
<br />
"verbs" is developed for Inkscape menu system, so "verbs" does not have any arguments. List of Inkscape "verbs" can be found at source code:<br /><br />
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/verbs.cpp#L2543<br />
<br />
<br />
== List of xverbs ==<br />
<br />
XFileSaveAs - save current document to specified filename<br />
XFileOpen - open specified .svg filename instead of current document<br />
XFileExportPNG - export to specified .png filename<br />
XSelectElement - select svg element by name<br />
XUndoLabel - set undo label<br />
UndoToLabel - undo to specified label<br />
<br />
<br />
== Additional info ==<br />
<br />
Some additional info can be found at maillist thread: <br /><br />
https://sourceforge.net/p/inkscape/mailman/inkscape-devel/thread/33487d06-e3c1-a4e5-1496-7b370d672d2f%40gmail.com/#msg35392523</div>Dmitryzhttps://wiki.inkscape.org/wiki/index.php?title=Using_xverbs&diff=105196Using xverbs2017-05-16T12:57:03Z<p>Dmitryz: initial version</p>
<hr />
<div><br />
inkscape --xverbs=xverbs.yaml<br />
<br />
Format of xverbs.yaml<br />
<br />
verbose: yes # only "verbose: yes" enable logging<br /><br />
run:<br />
# open document to process<br />
- xverb-id: XFileOpen, gfx_sources/loading_screen/sandclock_atlas.svg<br /><br />
# set label for XUndoToLabel xverb works<br />
# NB: if something wrong with undo labels use verb EditUndo instead of XUndoLabel and XUndoToLabel at all<br />
- xverb-id: XUndoLabel, fresh_document<br /><br />
# select element to handle<br />
- xverb-id: XSelectElement, top_sand<br /><br />
# verbs<br />
- verb-id: EditInvertInAllLayers<br />
- verb-id: EditDelete<br />
- verb-id: FitCanvasToDrawing<br /><br />
# save element to separated svg document<br />
- xverb-id: XFileSaveAs, output/thegame/linux/data/gfx/loading_screen/top_sand.svg<br /><br />
# also save png preview<br />
- xverb-id: XFileExportPNG, output/thegame/linux/data/gfx_preview/loading_screen/top_sand.png<br /><br />
# return to the fresh_state of document<br />
- xverb-id: XUndoToLabel, fresh_document<br /><br />
# do any other handling<br />
# Inkscape have a lot of useful verbs<br />
- verb-id: FileQuit</div>Dmitryz