CLI: Extensions need GUI

When I run Inkscape in CLI mode, and want to run an extension that needs currently selected elements, the currently selected elements are only passed if the CLI is run in GUI mode (with --batch-process parameter).
Otherwise, no IDs of selected elements will be passed to the extension python script.
I tracked it down to src/extension/implementation/script.cpp, where the _change_extension method is called from two different methods (both are overloaded Script::effect methods), one is for the case where a desktop is available, the other was added for "pure document version for calling an extension from the command line", and has no desktop.
But the current selection still can be extracted from the SPdocument*, so I made this patch that duplicates the passing of the selected elements as parameters to the extension from the other effect() method.

Am 20.06.25 um 13:56 schrieb Alexander Roalter:
When I run Inkscape in CLI mode, and want to run an extension that needs currently selected elements, the currently selected elements are only passed if the CLI is run in GUI mode (with --batch-process parameter).
Otherwise, no IDs of selected elements will be passed to the extension python script.
I tracked it down to src/extension/implementation/script.cpp, where the _change_extension method is called from two different methods (both are overloaded Script::effect methods), one is for the case where a desktop is available, the other was added for "pure document version for calling an extension from the command line", and has no desktop.
But the current selection still can be extracted from the SPdocument*, so I made this patch that duplicates the passing of the selected elements as parameters to the extension from the other effect() method.
Is this list dead?
On the page (https://inkscape.org/contribute/report-bugs/) it says:
New features, or wish list items may also submitted via the bug tracker system. Although again, if you are a new Inkscape user, you may want to discuss your idea on the mailing list, or in other forums
I have also opened a ticket at gitlab https://gitlab.com/inkscape/inbox/-/issues/12404
but only crickets...

On Wed, 2025-07-30 at 19:49 +0200, Alexander Roalter wrote:
Is this list dead?
No, it's pining for the fjords.
The main communication channel is chat.inkscape.org and the ML is mostly used as a record of meetings, announcements, requests from the project, etc. I recommend the chat room.
but only crickets...
If you can convince them to take up programming, we could do with the extra man power... or cricket power at any rate. 😉️
Your issue is a real issue, I see that. There are no guarantees it will be fixed though. It is the nature of volunteers that you just can't tell them to do things. Even important things.
Good luck!
Best Regards, Martin Owens
participants (2)
-
Alexander Roalter
-
Martin Owens