Hello, can anybody point me in the direction of understanding how to read a command line progress indicator to a Directory Opus Script Dialog? For example, when using Node.js I would use a construct called readLine. Before I begin digging around, I wanted to see if this is already been done. Thanks
Not entirely sure what you mean by "read a command line progress indicator", but since you mention Nodejs ReadLine(), are you talking about reading standard output from another process?
If that's it, AFAIK, there are not any DOpus specifics for that, but you can use standard WSH objects, like WshShell.Exec()
, to capture the output from a console app.
Yes!
But IMHO, this method is painfully inadequate, especially if you're using it in a script dialog, mainly because the capture will run syncronously, causing the dialog to remain frozen during that time.
Instead I suggest as a better workaround: running the app normally but in a separated thread (using dopusrt and another command you set up previously for that purpose), and writing the output to a temp file. Then read the content into a DO variable, which can be seen by the 'main' thread where the dialog is. In the meantime, the dialog can either wait or perform other tasks, but without any visible freeze.
That sounds like something I would like to learn how to do. If any examples don't hesitate.
Thanks
An example that comes to mind would be this command. Basically you can see how the script calls itself in another thread, and intercommunicates between two with variables while displaying a progress dialog. I think it can serve as a base for you.
That sounds like something I would like to learn how to do...
I was way too hasty. I first need to understand how fundamentally threading works with Directory Opus. I mean connecting Opus to something external, like a command line app via threading.
(using dopusrt and another command you set up previously for that purpose)
I will take a look at dopusrt. If you or anybody else have any basic examples, please share.
I have to ask, does a thread in this context just mean using dopusrt.exe /runstd notepad.exe
like so? I saw that in the information in the Directory Opus manual. Thanks
There aren't really any threads involved here; the command you run will be in a separate process.
These posts may be useful, if the aim is to run a command and capture its output: