Inkscape doesn't exit after being called from Powershell Script

Using Inkscape with other software? Talk about it here.
Aido
Posts: 1
Joined: Tue Jul 04, 2017 9:16 am

Inkscape doesn't exit after being called from Powershell Script

Postby Aido » Tue Jul 04, 2017 9:19 am

I've tried calling Inkscape with both

Code: Select all

inkscape.exe --export-png "$filedir\$filename.png" -w 512 "$filedir\$filename.svg"
and

Code: Select all

"--export-png `"$filedir\$filename.png`" -w 512 `"$filedir\$filename.svg`"`nexit" | inkscape.exe --shell
from a Powershell ps1 script, but after both, it never exits. What am I doing wrong?

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Inkscape doesn't exit after being called from Powershell Script

Postby Moini » Wed Jul 05, 2017 12:48 am

Add a --FileQuit at the end to close the opened file and all windows of the current Inkscape instance.

The other option is --FileClose, which will only close the current file, but keep at least one Inkscape window open.


Edit: See below for correct info!
Last edited by Moini on Thu Jul 06, 2017 11:45 pm, edited 1 time in total.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Inkscape doesn't exit after being called from Powershell Script

Postby ~suv » Thu Jul 06, 2017 10:31 pm

Off topic:
Moini wrote:Add a --FileQuit at the end to close the opened file and all windows of the current Inkscape instance.

The other option is --FileClose, which will only close the current file, but keep at least one Inkscape window open.
Not really:

Code: Select all

** (inkscape:10311): WARNING **: Invalid option --FileQuit

** (inkscape:10324): WARNING **: Invalid option --FileClose
FileQuit and FileClose are verbs (usage would be '--verb=FileQuit' or '--verb=FileClose'), not command line options. Verbs are not relevant when exporting to PNG via command line (they even can cause Inkscape to crash in the context of 'real' command line options like '--export-png').


It seems likely to me that Aido experiences a variation of Bug #1659172 “command line sometimes freezes”.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Inkscape doesn't exit after being called from Powershell Script

Postby Moini » Thu Jul 06, 2017 11:44 pm

Mmh. Thanks, V!
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)


Return to “Inkscape & other”