Attempting to create an extension in Pascal (fpc) and having problems.
Inkscape calls my program correctly (which 'seems' to work ok), but doesnt change anything within Inkscape when it returns (no errors or logs created)
My understanding of the process is -
Inkscape calls my program with 'selection' and 'tmpfilename' on the command line
My program modifies the svg as necessary
My program outputs the changed svg (full file) onto stdout, with an exit code of 0.
As a test, why does the following not work ?
1 - I create an Inkscape file, saved as 'Work1'
2 - I create a copy of 'Work1' and make a minor modification to it - saved as 'Work2'
3 - My extension (inx) file calls 'Test.bat' in the extensions folder
4 - 'Test.bat' has a single line: type Work2
If I open 'Work1' in Inkscape, then run my extension 'Test' (which merely returns the modified 'Work2' on stdout) why doesnt Inkscape update onscreen ?
I'm hoping that the answer to this will also show where I'm going wrong in my pascal program
Thanks heaps for any help on this
Creating Extensions
Re: Creating Extensions
SteveG wrote:4 - 'Test.bat' has a single line: type Work2
That won't work, since the batch file will echo the command to stdout before executing it. Have you tried using
@type Work2
to suppress the echo?
Re: Creating Extensions
Thanks sas - works perfectly with the suppression
Now just need to figure why a problem with my pascal program (simple though it is) - but this at least shows its actually possible
sometimes you need to do magic to believe in magic
Now just need to figure why a problem with my pascal program (simple though it is) - but this at least shows its actually possible
sometimes you need to do magic to believe in magic
Re: Creating Extensions
Are you sure you've got the command-line arguments right? You can check what they are by writing them to stderr (so that Inkscape will display them after the extension has run). In your Test.bat this can be done by adding the line
@echo %* 1>&2
and no doubt you know how to do it in Pascal.
Have you tried running your Pascal program on its own, with the appropriate command-line arguments, and checking that Inkscape can open the file it produces?
If it works on its own, with the same command-line arguments that Inkscape passes it, then I don't know what can be wrong, unless there's a problem with the .inx file.
@echo %* 1>&2
and no doubt you know how to do it in Pascal.
Have you tried running your Pascal program on its own, with the appropriate command-line arguments, and checking that Inkscape can open the file it produces?
If it works on its own, with the same command-line arguments that Inkscape passes it, then I don't know what can be wrong, unless there's a problem with the .inx file.