Hi,
I was trying to write my own extension, and I was wondering if it was at all possible to access shortcuts within the script. Specifically, Is there any way an inkscape extension can automatically select all objects in a given svg image? I know I can do it with ctrl+a but I was hoping there was a way of doing it automatically.
Thanks in advance,
Nathan
Shortcuts in inkscape extensions
Re: Shortcuts in inkscape extensions
My very limited understanding of Inkscape extensions - based on creating just one - is that they are external programs that are passed a complete copy of the XML, plus a collection of selected objects. They return a modified copy of the XML. There's no way that I could find to also return a selection, or to trigger any keyboard shortcuts within Inkscape itself.
Essentially an extension is a black box with XML fed in at one end, and XML coming out at the other end. There's not really any interaction with Inkscape itself, other than as a source and sink for the XML.
Essentially an extension is a black box with XML fed in at one end, and XML coming out at the other end. There's not really any interaction with Inkscape itself, other than as a source and sink for the XML.
Re: Shortcuts in inkscape extensions
Xav wrote:My very limited understanding of Inkscape extensions - based on creating just one - is that they are external programs that are passed a complete copy of the XML, plus a collection of selected objects. They return a modified copy of the XML. There's no way that I could find to also return a selection, or to trigger any keyboard shortcuts within Inkscape itself.
Essentially an extension is a black box with XML fed in at one end, and XML coming out at the other end. There's not really any interaction with Inkscape itself, other than as a source and sink for the XML.
Xav, you are right... but in theory it's possible to have some access to some features of Inkscape using the command line"verbs" system
http://tavmjong.free.fr/INKSCAPE/MANUAL ... Query.html
Some extensions implement this feature (the export to synfig extension, if I'm not wrong)... but you have to code it. A better approach would if were just a module...I guess...
From time to time, this same topic is discussed here in the forum.
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.
Re: Shortcuts in inkscape extensions
hulf2012 wrote:
Xav, you are right... but in theory it's possible to have some access to some features of Inkscape using the command line"verbs" system
http://tavmjong.free.fr/INKSCAPE/MANUAL ... Query.html
Some extensions implement this feature (the export to synfig extension, if I'm not wrong)... but you have to code it. A better approach would if were just a module...I guess...
From time to time, this same topic is discussed here in the forum.
I don't get it.
As Xav said the extension is called with the path of an xml file (and a list of selected items) and wrote a [modified] xml.
I don't see when you could pass a query to [the already running instance of] inkscape.
Unless your extension calls another [hidden] instance of inkscape which would be quite complicated imho
I'd be glad to hear more about interacting with inkscape from an extension.
Re: Shortcuts in inkscape extensions
v1nce wrote:I don't get it.
As Xav said the extension is called with the path of an xml file (and a list of selected items) and wrote a [modified] xml.
I don't see when you could pass a query to [the already running instance of] inkscape.
Unless your extension calls another [hidden] instance of inkscape which would be quite complicated imho
I'd be glad to hear more about interacting with inkscape from an extension.
That is the idea... I think
See this link... the comments at the end also have information
http://www.janthor.com/sketches/index.p ... scape.html
Greetings
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.
-
- Posts: 6
- Joined: Wed May 20, 2015 3:16 am
Re: Shortcuts in inkscape extensions
Looks really promising! However, when I call the --query-all command, the resulting coordinates are very different from the actual object locations. Why are they different? and is there some way I can compensate for that?
For example, one of the entries in --query-all comes out as:
text399, 30762.015, 12013.469
However, the actual coordinates of text399 is 30949.857, 12123.882
For example, one of the entries in --query-all comes out as:
text399, 30762.015, 12013.469
However, the actual coordinates of text399 is 30949.857, 12123.882
-
- Posts: 6
- Joined: Wed May 20, 2015 3:16 am
Re: Shortcuts in inkscape extensions
Well, it's working now. Guess the translated locations are proportionally the same.
Thanks so much!
Thanks so much!