--- In [email protected], "quantiworks" <quanticwo...@...> wrote:
>
> "Sheri" wrote:
> 
> > In the test script I posted earlier, you would of course need to change it 
> > to opera.exe.
> 
> Yeah, of course. :)
> 
> > Did it work ok?
> 
> Yes. Sorry for the delay, I've been out...
> 
> > Opera Starts -> get the processid and start an event via autorun
> > every x time periods, the event would run a script for the processid
> 
> = $=opera
> = win.getprocessid("AutoRun"), event.create(3minutes,0, ????

I believe win.getprocessid takes a handle, not a caption list, e.g., 
win.getprocessid(win.handle("caption-list"))
> 
> > script:
> > - see if the processid is still running, if not destroy the event
> 
> If pid exists? 
> Do .operaRAM
> Else event.destroy(?
> 
> > - get the workingsetsize
> > - if workingsetsize > max show an ontop messagebox with restart options and 
> > destroy the event
> 
> If 200 >max
> Do ontop messagebox(?
> 
> > - depending on the selected option, start a new event for the existing 
> > processid
> > or kill the process and restart opera (restarting would trigger a new event 
> > for the new process id).
> 
> How would I do that?

How to process a selection? Messagebox returns a result. For a YesNo 
messagebox, if 6 is returned, Yes was selected. So you can have logical 
processing based on the response to the messagebox.

How to kill the process? You can try window.close("=Opera"). If that doesn't 
totally work, add win.terminateprocess(pid).

To restart Opera, you would add do("path/to/Opera/opera.exe").

> What I wrote above is me trying to understand the sequence,
> I definitely need to complete reading PPST to start writing some 
> scripts.
>

I would suggest to do the whole thing in one script. That script could have 
functions to launchevent, makeevent, destroyevent, testlimit and 
querywmiprocess. You should test it before adding it to autorun by launching 
launchevent yourself for awhile. Launchevent could have arguments for input 
handle, memory limit, and interval for testing. While testing it, the input 
handle could be win.handle("=Opera"). e.g.
 
.myscr...@launchevent(win.handle("=Opera"), 50000, 120)

When you eventually run it from the Autorun command list, the command entry 
could be:

.myscr...@launchevent(win.handle("autorun"), 50000, 120)

Regards,
Sheri


Reply via email to