Cannot close process after calling 'launch' to browser path
bdrunrev at gmail.com
Mon Feb 1 06:51:32 EST 2010
Sorry Mark, I didn't see this email of yours until today. I think the
problem with you being unable to close the browser this way is that
although the 'launch' command opens a GUI program and lists the
program in the openProcesses/openProcessIDs, a program launched in
this way does not respond to "close process" (presumably because the
process does not leave open stdio).
Anyway, there is a way to do it, but its a tad messy (see the
Dictionary entry for 'kill'):
put the openProcessIds into tIDList
repeat for each line tID in tIDList -- kill all open processes
kill 9 process tID
Of course you may want to kill only 1 of the openProcesses, so you
will need to fashion a way to identify your open process from the
others. I guess the best thing in such a situation is to keep a
dictionary of process name to process id mappings - then you can find
the id from your process name and kill it.
Choosing to kill by process path/name does not work in my experience.
I hope that is of some help.
On Tue, Jan 20, 2009 at 7:11 PM, Mark E. Powell <runrev at aboutmyfiles.com> wrote:
> I am using 'launch' to open HTML reports from my standalone:
> put word 1 of queryRegistry("HKEY_LOCAL_MACHINE\Software\Classes\http\shell\open\command\") into tBrowserPath
> launch vLongFileName with tBrowserPath
> This works for the first report of a standalone session. It works if the browser window for report 1 is closed before doing subsequent reports. However, it returns 'process is already open' in all other cases.
> I have explicitly tried closing the tBrowserPath process, and have tried closing all open processes, but it does not prevent the return of 'process already open'.
> What am I missing?
More information about the Use-livecode