nsonln Posted April 19, 2007 Share Posted April 19, 2007 Here is what I have: Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",1) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) $n = 13 $r = 0 Do MsgBox(0, "Test","$n = " & $n & " &r = " & $r,3) GETSCSDATA($n,$r) Sleep(3000) Until $r = 1 MyCloseFunction() Func MyCloseFunction() Exit EndFunc Func GETSCSDATA($num,$rep) Run('C:\WINDOWS\system32\mmc.exe /s "C:\Program Files\Symantec\Symantec System Center\Symantec System Center.msc"') WinWait("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents]","Console Root\Symante") If Not WinActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents]","Console Root\Symante") Then WinActivate("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents]","Console Root\Symante") WinWaitActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents]","Console Root\Symante") Send("{APPSKEY}u") WinWait("Unlock Server Group","Remember this user n") If Not WinActive("Unlock Server Group","Remember this user n") Then WinActivate("Unlock Server Group","Remember this user n") WinWaitActive("Unlock Server Group","Remember this user n") Send("{ENTER}") WinWait("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents]","Console Root\Symante") If Not WinActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents]","Console Root\Symante") Then WinActivate("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents]","Console Root\Symante") WinWaitActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents]","Console Root\Symante") Send("{DOWN}") WinWait("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents\Groups]","Console Root\Symante") If Not WinActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents\Groups]","Console Root\Symante") Then WinActivate("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents\Groups]","Console Root\Symante") WinWaitActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents\Groups]","Console Root\Symante") Send("+{DOWN " & $n & "}") Sleep(1000) IF WinActive("Symantec System Center - [Console Root\Reporting]","Console Root\Reporti") Then Send("{ALTDOWN}{F4}{ALTUP}") WinWait("Microsoft Management Console","Save console setting") If Not WinActive("Microsoft Management Console","Save console setting") Then WinActivate("Microsoft Management Console","Save console setting") WinWaitActive("Microsoft Management Console","Save console setting") Send("n") $r = 1 EndIf WinWait("Program Manager","FolderView") If Not WinActive("Program Manager","FolderView") Then WinActivate("Program Manager","FolderView") WinWaitActive("Program Manager","FolderView") Sleep(1000) WinWait("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") If Not WinActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") Then WinActivate("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") WinWaitActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") Sleep(1000) Send("{ALTDOWN}{ALTUP}al") WinWait("Export List","Save &Only Selected ") If Not WinActive("Export List","Save &Only Selected ") Then WinActivate("Export List","Save &Only Selected ") WinWaitActive("Export List","Save &Only Selected ") Send("{SHIFTDOWN}dv{SHIFTUP}" & $n & "{ENTER}") WinWait("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") If Not WinActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") Then WinActivate("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") WinWaitActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") Send("v{ALTDOWN}{ALTUP}v{DOWN}{UP}{UP}{ESC}{ALTDOWN}{ALTUP}vs{ENTER}") Sleep(1000) Send("{ALTDOWN}{ALTUP}al") WinWait("Export List","Save &Only Selected ") If Not WinActive("Export List","Save &Only Selected ") Then WinActivate("Export List","Save &Only Selected ") WinWaitActive("Export List","Save &Only Selected ") Send("{SHIFTDOWN}av{SHIFTUP}" & $n & "{ENTER}") WinWait("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") If Not WinActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") Then WinActivate("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") WinWaitActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") Send("{ALTDOWN}{ALTUP}vss{ENTER}{ALTDOWN}{ALTUP}al") WinWait("Export List","Save &Only Selected ") If Not WinActive("Export List","Save &Only Selected ") Then WinActivate("Export List","Save &Only Selected ") WinWaitActive("Export List","Save &Only Selected ") Send("{SHIFTDOWN}fw{SHIFTUP}" & $n & "{ENTER}") WinWait("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") If Not WinActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") Then WinActivate("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") WinWaitActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") Send("{ALTDOWN}{F4}{ALTUP}") WinWait("Microsoft Management Console","Save console setting") If Not WinActive("Microsoft Management Console","Save console setting") Then WinActivate("Microsoft Management Console","Save console setting") WinWaitActive("Microsoft Management Console","Save console setting") Send("n") $n = $n + 1 EndFunc When $r = 1 the script stops running but stays in the tasktray. I want it to completely close... Any ideas please? Link to comment Share on other sites More sharing options...
Uten Posted April 19, 2007 Share Posted April 19, 2007 (edited) Hi, could you format your code? Use the blue A button in the web editor to get the autoit coloring tags. Also indenting code would be helpful. Make sure to use Global or Local to declare your variables. My guess is that you never reach the until part of the loop. EDIT: PS, Welcome to the forum.. Edited April 19, 2007 by Uten Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
evilertoaster Posted April 19, 2007 Share Posted April 19, 2007 Hi should use some code or autoit tags when posting this much, but try this- expandcollapse popupOpt("WinWaitDelay",100) Opt("WinTitleMatchMode",1) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) $n = 13 $r = 0 Do MsgBox(0, "Test","$n = " & $n & " &r = " & $r,3) GETSCSDATA($n,$r) Sleep(3000) Until $r = 1 MyCloseFunction() Func MyCloseFunction() Exit EndFunc Func GETSCSDATA($num,$rep) Run('C:\WINDOWS\system32\mmc.exe /s "C:\Program Files\Symantec\Symantec System Center\Symantec System Center.msc"') WinWait("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents]","Console Root\Symante") If Not WinActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents]","Console Root\Symante") Then WinActivate("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents]","Console Root\Symante") WinWaitActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents]","Console Root\Symante") Send("{APPSKEY}u") WinWait("Unlock Server Group","Remember this user n") If Not WinActive("Unlock Server Group","Remember this user n") Then WinActivate("Unlock Server Group","Remember this user n") WinWaitActive("Unlock Server Group","Remember this user n") Send("{ENTER}") WinWait("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents]","Console Root\Symante") If Not WinActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents]","Console Root\Symante") Then WinActivate("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents]","Console Root\Symante") WinWaitActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents]","Console Root\Symante") Send("{DOWN}") WinWait("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents\Groups]","Console Root\Symante") If Not WinActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents\Groups]","Console Root\Symante") Then WinActivate("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents\Groups]","Console Root\Symante") WinWaitActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents\Groups]","Console Root\Symante") Send("+{DOWN " & $n & "}") Sleep(1000) IF WinActive("Symantec System Center - [Console Root\Reporting]","Console Root\Reporti") Then Send("{ALTDOWN}{F4}{ALTUP}") WinWait("Microsoft Management Console","Save console setting") If Not WinActive("Microsoft Management Console","Save console setting") Then WinActivate("Microsoft Management Console","Save console setting") WinWaitActive("Microsoft Management Console","Save console setting") Send("n") EndIf $r = 1 WinWait("Program Manager","FolderView") If Not WinActive("Program Manager","FolderView") Then WinActivate("Program Manager","FolderView") WinWaitActive("Program Manager","FolderView") Sleep(1000) WinWait("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") If Not WinActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") Then WinActivate("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") WinWaitActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") Sleep(1000) Send("{ALTDOWN}{ALTUP}al") WinWait("Export List","Save &Only Selected ") If Not WinActive("Export List","Save &Only Selected ") Then WinActivate("Export List","Save &Only Selected ") WinWaitActive("Export List","Save &Only Selected ") Send("{SHIFTDOWN}dv{SHIFTUP}" & $n & "{ENTER}") WinWait("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") If Not WinActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") Then WinActivate("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") WinWaitActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") Send("v{ALTDOWN}{ALTUP}v{DOWN}{UP}{UP}{ESC}{ALTDOWN}{ALTUP}vs{ENTER}") Sleep(1000) Send("{ALTDOWN}{ALTUP}al") WinWait("Export List","Save &Only Selected ") If Not WinActive("Export List","Save &Only Selected ") Then WinActivate("Export List","Save &Only Selected ") WinWaitActive("Export List","Save &Only Selected ") Send("{SHIFTDOWN}av{SHIFTUP}" & $n & "{ENTER}") WinWait("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") If Not WinActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") Then WinActivate("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") WinWaitActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") Send("{ALTDOWN}{ALTUP}vss{ENTER}{ALTDOWN}{ALTUP}al") WinWait("Export List","Save &Only Selected ") If Not WinActive("Export List","Save &Only Selected ") Then WinActivate("Export List","Save &Only Selected ") WinWaitActive("Export List","Save &Only Selected ") Send("{SHIFTDOWN}fw{SHIFTUP}" & $n & "{ENTER}") WinWait("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") If Not WinActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") Then WinActivate("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") WinWaitActive("Symantec System Center - [Console Root\Symantec System Center\System Hierarchy\TVM-SCS3-WorkstationParents","Console Root\Symante") Send("{ALTDOWN}{F4}{ALTUP}") WinWait("Microsoft Management Console","Save console setting") If Not WinActive("Microsoft Management Console","Save console setting") Then WinActivate("Microsoft Management Console","Save console setting") WinWaitActive("Microsoft Management Console","Save console setting") Send("n") $n = $n + 1 EndFunc You had a $r=1 assignment inside an If-Then-Endif Case that may never execute. Link to comment Share on other sites More sharing options...
SleepyXtreme Posted April 19, 2007 Share Posted April 19, 2007 i have this same problem Link to comment Share on other sites More sharing options...
Richard Robertson Posted April 19, 2007 Share Posted April 19, 2007 Running a function with a single line of code is useless. Just use Exit alone. Also, you say the script stops, but stays in the tray; Does it still respond to being clicked on or does it disappear? Link to comment Share on other sites More sharing options...
Developers Jos Posted April 19, 2007 Developers Share Posted April 19, 2007 Add Opt("TrayIconDebug", 1) at the top to see on what line the script is pausing .. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
herewasplato Posted April 19, 2007 Share Posted April 19, 2007 (edited) Add AutoItSetOption ("TrayIconDebug", 1) ;0-offto the top of your script and mouse over the AutoIt icon after $r=1. That should tell you what line the script is on. Edit: Too slow Edited April 19, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now