Inkscape.org
Creating New Extensions Call Extension in batch mode
  1. #1
    bernie70 bernie70 @bernie70
    *
    <inkscape-extension>
      <_name>Insert Astrodaten</_name>
      <id>org.ekips.filter.pktprog_astro</id>
    	  <dependency type="executable" location="extensions">pktprog_astro.py</dependency>
      <param name="location" type="optiongroup" _gui-text="Location:">
         <option>Aigen/Ennstal</option>
         <option>Allentsteig</option>
         <option>Ausseerland</option>
         <option>Graz</option>
         <option>Hochfilzen</option>
         <option>Innsbruck</option>
         <option>Klagenfurt</option>
         <option>Langenlebarn</option>
         <option>Lienz</option>
         <option>Linz</_option>
         <option>Mariazell</option>
         <option>Rheintal</option>
         <option>Salzburg</option>
         <option>St. Johann/Pg</option>
         <option>Wien</option>
         <option>Wiener Neustadt</option>
         <option>Zeltweg</option>
         <option>Landeck</option>
     </param>
    
      <effect>
        <object-type>all</object-type>
        <effects-menu>
           <submenu _name="Aktualisieren Met-Daten">
             <submenu name="PktProg"/>
           </submenu>
        </effects-menu>
      </effect>
      <script>
        <command reldir="extensions" interpreter="python">pktprog_astro.py</command>
      </script>
    </inkscape-extension>

    Hello,

    I created an extension. It works fine if I call the extension manually when i opened an inkscape drawing.

    I saw, that it is possible to call inkscape in PowerShell with inkscpe.com --actions=org.ekips.filter.pktprog-astro (I selected the Extension from the output of inkscape.com --actions-list).

    In my extension I have an option group with some options to select. Is it possible to pass an option also in batch mode?

    Above I attached my inx-file.

    Best regards,
    Bernhard

     

     

  2. #2
    inklinea inklinea @inklinea⛰️

    At the moment it is not possible to pass parameters to extensions via the command line. ( This may appear in later versions of Inkscape )

    inkscape --batch-process --actions="org.ekips.filter.pktprog_astro.noprefs;export-filename:my_file_out.svg;export-do" drawing.svg

    the .noprefs means that a dialogue box will not be displayed to the user when Inkscape is run from the command line.

    At the moment 1.2/1.3 the --batch-process option is required to use most extensions without crashing.

    --batch-process opens and closes the gui in the background, so makes things quite slow.

    If you want to send parameters to the command line, it would require a serious workaround.