Jump to content

Stuck Process / System Tray Icon


Recommended Posts

Not sure if this is a simple question or necessitates posting code.

Anyway...I have a script that automates a GUI based user configuration process for an application called SoftMax Pro. It accesses a drop down menu, does a couple clicks, enters user and password credentials, etc. Fairly simple overall and works generally pretty well.

On occasion, depending apparently on things I don't yet understand, the script will occasionally pause and freeze without entering the credentials. I'm continuing to look into why. When this happens the user gets a little system tray icon (I've packaged it as a .exe) and the process stays there. If they run it again, they get aditional system tray icons for the script, and until it gets unpaused they just sit. When they do unpause they run all at once and jumble up the text entries.

Again, this isn't a common occurrance. But when it does, the end user doesn't understand how to clear it out and re-run it. Is there a simple way to get the whole AutoIt .exe process to close if it freezes or fails out? Or some sort of VBScript-like On Error Resume Next functionality, etc?

Hopfully my question is making sense. I'm far from a pro at this, so I'm hoping I'm missing something obvious'

Thanks.

Link to comment
Share on other sites

On occasion, depending apparently on things I don't yet understand, the script will occasionally pause and freeze without entering the credentials. I'm continuing to look into why. When this happens the user gets a little system tray icon (I've packaged it as a .exe) and the process stays there. If they run it again, they get aditional system tray icons for the script, and until it gets unpaused they just sit. When they do unpause they run all at once and jumble up the text entries.

Again, this isn't a common occurrance. But when it does, the end user doesn't understand how to clear it out and re-run it. Is there a simple way to get the whole AutoIt .exe process to close if it freezes or fails out? Or some sort of VBScript-like On Error Resume Next functionality, etc?

Thanks.

sounds like your code is waiting/expecting a window/text which does not appear, or at least not in the order you expect it and then it just waits forever. Unfortunately there is no easy way to "auto-kill" a waiting script (well it depends on the script and the way it is stuck). What you can do is, to check at startup of the script if there is already an instance of it running and then kill it (ProcessClose). At least this will help the user by not filling up the systray ...

Cheers

Kurt

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Maybe a dumb question but...

If I check to see whether the AutoIt process is running, by the time I do that...it will be running (even if it wasn't before)...in order to check if it's running...

Is there a way to check for a previous instance vs. the new one just launched?

Link to comment
Share on other sites

If I check to see whether the AutoIt process is running, by the time I do that...it will be running (even if it wasn't before)...in order to check if it's running...

Is there a way to check for a previous instance vs. the new one just launched?

get a list of the processes with ProcessList(). ProcessList() will return a list with all process names and their PIDs. Check if there is something with the same name. Then kill everything with the same name where the PID <> @AutoItPID

Note: If you run the script without compiling it, then the process name will allways be autoit.exe. If you compile the script, the process name will be <whatever>.exe.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...