Subject: Forum activity on: Extension fo automating menu selection
From: [email-masked]
To: [email-masked]
Date: Thu, 19 Sep 2024 05:24:39 -0000

Dear cosmobird,

A new post on the topic "Extension fo automating menu selection" by inklinea:
---
You don't actually need to do any coding as such to achieve this.Every extension has a minimum of 2 parts. The .inx file and the .py file.The .inx file is an xml file which creates the Extensions menu entry in the Inkscape gui, and also (optionally) creates a gui for the extension.The menu entry can also be hidden if required. So it does not appear in the Inkscape gui Extensions menu.When an extension is launched and applied, Inscape remembers the last setting if the .inx provides a gui. If Inkscape is exited cleanly, this info is also stored in preferences.xml in the user folder so persists between sessions.You can have as many .inx files as you want provided they do not have a conflicting <id> in the xml. If the <id> is duplicated, the new entry and the original will usually fail.This is a convenient way to assign many presets to shortcut keys.Every .inx file automatically creates 2 actions which appear under Edit>Preferences>Interface>Keyboard. Those entries correspond with the <id> you have assigned, and allow the launching of the extension either with or without triggering any .inx gui. The one that does not trigger the gui has .noprefs appended to it in the shortcut list.So in your case. All you need to do.- Make a duplicate of gcodetools_tools_library.inx in the same folder- edit the <id> so it is unique- you should also probably edit the <name> entry (this creates the name that appears in the Extension menu), this is not required but makes it less confusing.- If you want to put it elsewhere in the Extensions Menu then edit the <submenu> tag.For example:<effects-menu>            <submenu name="Gcodetools">                <submenu name="Gcodetools Hack"/>                </submenu>        </effects-menu>        Would make a submenu in the existing Gcodetools menu, you can make as many submenus as you like.Don't forget to remove the closing '/' from each parent tag and put a closing tag in there.It is alway necessary to restart Inkscape for .inx edits to take effect.Run your new extension once, with whatever settings you want in any gui - those will be save to Inkscape.Assign a shortcut key as mentioned above. You want to the .noprefs verision of the shortcut.If you want to make the entry hidden in the Extensions menu then use <effects-menu hidden="true">Again, you need to restart Inkscape for this to take effect.Of course you can craft your own .inx file too, but generally it's not worth it unless you have a specific requirement.It's just simpler to launch the .inx you have made, run it once to set the settings, then shortcut to the .noprefs
----
Link: http://www.inkscape.org/forums/extensions/extension-fo-automating-menu-selection/#c74650

All the best,
 Inkscape.org Website

~~~~~~~~~~~~~~~~~~~~~~~~~
Unsubscribe:

If you do no longer want to receive these messages, you can edit your subscriptions and notification settings at http://www.inkscape.org/alerts/settings/.