Inkscape.org
Beyond the Basics Can anyone decipher this? object-align : Align selected objects; usage: [[left|hcenter|right] || [top|vcenter|bottom]]
  1. #1
    wyattjackson wyattjackson @wyattjackson

    Hi,

    Can anyone decipher this?  object-align : Align selected objects; usage: [[left|hcenter|right] || [top|vcenter|bottom]] [last|first|biggest|smallest|page|drawing|selection|pref]? group? anchor?

    This line is in the CLI actions list.  There are no examples of its usage.  Just this brief description of its usage.  Nothing I have tried seems to work.

    Is it?

    object-align:[[hcenter]||[vcenter]][page]

    or 

    object-align:hcenter,vcenter,page

     

    Is anyone using this successfully?

     

    Wyatt

     

  2. #2
    inklinea inklinea @inklinea⛰️

    Yes, 

    Square brackets mean optional.

    Pipes mean a choice.

    inkscape --actions="select-by-id:rect1,path1;select-list;object-align:hcenter top first;export-filename:align.png;export-do" ./drawing.svg
     

    In the above example, I have a rectangle (id rect1) and an ellipse (id path1).

    I use select-list to output the current selection list to the command line so I can check I have selected correctly.

    object-align:hcenter top first this basically mirrors the choices in the alignment panel in the gui. I want to align horizontal centre, vertical top and relative to the first selected object.

    In versions of Inkscape prior to 1.2, the default was to use the last settings of the align panel when Inkscape was last cleanly exited. I think thats what the prefs option means.

    I've always had a problem understanding literal syntax vs what is a instuction to the user ( and is not typed )

    I think they are called "Command syntax conventions"

     

Inkscape Inkscape.org Inkscape Forum Beyond the Basics Can anyone decipher this? object-align : Align selected objects; usage: [[left|hcenter|right] || [top|vcenter|bottom]]