(Simplest solution: avoid to run the plugin on Windows)
There are several criteria that seem to exclude each other when working out a solution for Windows.
- You want to run it “quiet” and avoid the black scary command prompt.
- You may not want to freeze SketchUp’s single-threaded Ruby process and the whole UI: not completely synchronous.
- You may want to know when it is finished: not completely asynchronous.
- You may want to have stdout and stderr.
I thought my old TextureResizer code was ugly and I wanted to renovate it. Most of all I wanted get rid of writing output to temporary files. After a long research it turned out the only, commonly used solution was similar to what I already had. Take a look into the latest async_batch.rb
in TextureResizer on EWH (my API wraps it into a promise which you maybe do not need).
- Running a batch file with
call
orstart
always opens a black GUI window. The standard work-around is to invoke it from a visual basic script withwscript
. - I dispatch the process asynchronously.
- I have to observe when the external process completes. Currently I do this with SketchUp’s asynchronous UI timer.
- To get stdout/stderr from an IO object, you would need to run synchronously. But when you use
handle = WsShell.Exec
you get again a flashing black window. Otherwise, the output is empty and the only workaround is to write&read it from a file.
It is 2018 and this is a sad story.