Edit layer preferences (per verb-id on command line) don't work

Bug #1419257 reported by Lebostein

This bug report was converted into a question: question #263157: Edit layer preferences (per verb-id on command line) don't work.

6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Undecided
Unassigned

Bug Description

Hi.

I want to edit layer preferences via command line. For example, this works:

inkscape --verb=LayerShowAll --verb=FileSave --verb=FileClose myfile.svg
inkscape --verb=LayerHideAll --verb=FileSave --verb=FileClose myfile.svg
inkscape --verb=LayerUnlockAll --verb=FileSave --verb=FileClose myfile.svg
inkscape --select=layer1 --verb=ObjectFlipVertically --verb=FileSave --verb=FileClose myfile.svg

But all other commands based on the current selected layer don't work. For example:

inkscape --select=layer1 --verb=LayerToTop --verb=FileSave --verb=FileClose myfile.svg
inkscape --select=layer1 --verb=LayerSolo --verb=FileSave --verb=FileClose myfile.svg
inkscape --select=layer1 --verb=LayerDuplicate --verb=FileSave --verb=FileClose myfile.svg

It seems that the "--select=layer1" don't select the layer with that id.

Revision history for this message
su_v (suv-lp) wrote :

On 2015-02-07 12:23 (+0100), Lebostein wrote:
> It seems that the "--select=layer1" don't select the layer with that id.

Wrong logic - please try the same steps in Inkscape, using the XML editor, or 'Ctrl+F' (Edit > Find).

If you select a layer group by id, this does not make that group the _current layer_ (its ancestor aka parent group or container element is, however).

If you select a top-level layer by id, the current layer will be 'root' (the root <svg> element), and you can't restack that current layer, since its the only one on that level.

The layer commands (and verbs) work on the _current_ layer - in the GUI you set the current layer either via 'Layers' dialog, or by clicking on an object contained _within_ that layer. So to mimic this via command line, you'd have to try to change the current layer by selecting an object by id from within that layer (I haven't tested myself yet whether this works at all on the command line, since 'current layer' seems to be more of a GUI concept to me, rather than something designed to work via verbs on the command line).

tags: added: cli layers selection
Revision history for this message
su_v (suv-lp) wrote :

Please add information about OS/platform and Inkscape version (see Inkscape menu 'Help > About Inkscape') to the bug description.

Changed in inkscape:
status: New → Incomplete
Revision history for this message
su_v (suv-lp) wrote :

Test case attached, verb 'LayerSolo' works ok on the command line, see example below (tested with 0.91 on OS X 10.7.5):

file structure:
- layer1
-- group_layer1
--- rect_layer1
--- text_layer1
- layer2
-- group_layer2
--- rect_layer2
--- text_layer2
- layer3
-- group_layer3
--- rect_layer3
--- text_layer3

$ cp lp1419257.svg tmp.svg
$ inkscape --select=group_layer2 --verb=LayerSolo --verb=FileSave --verb=FileQuit --file=tmp.svg

Revision history for this message
su_v (suv-lp) wrote :

Result saved via cli as detailed in prior comment.

Revision history for this message
Lebostein (lebostein) wrote :

Ok. And how I select a layer to use the verbs LayerToTop or LayerSolo?

Revision history for this message
su_v (suv-lp) wrote :

Please re-read comment 1 and 3 - explained, and demonstrated with an example for 'LayerSolor'.

Revision history for this message
su_v (suv-lp) wrote :

Correction (typo):
- and demonstrated with an example for 'LayerSolor'.
+ and demonstrated with an example for 'LayerSolo'.

Revision history for this message
su_v (suv-lp) wrote :

Proposing to close report with status 'Invalid' - this is q question about usage, not a bug in inkscape.

jazzynico (jazzynico)
Changed in inkscape:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.