JohnBailey Posted January 17, 2007 Posted January 17, 2007 (edited) How Do I display/obtain a return value from WinWaitClose?Specifically:The last function does not execute and I would like to get an error to be displayed via MsgBox().How do I do this?#include<.\Include\jClassOpenProgram.au3> $firstProgram = "Total Service Manager F:\TSM60\DATA\" $secondProgram = "Adobe Acrobat Professional - [" & $fileName & "]" closeProgram($firstProgram) WinWaitClose("Total Service Manager F:\TSM60\DATA\",2) closeProgram($secondProgram) WinWaitClose("Adobe Acrobat Professional - [" & $fileName & "]") msgbox(64,"Finished Automation","The automated process is complete. You may now safely use your keyboard and mouse.",10) Edited January 17, 2007 by JohnBailey A decision is a powerful thing
_Kurt Posted January 17, 2007 Posted January 17, 2007 (edited) Well, to quote the helpfile: Return Value Success: Returns 1. Failure: Returns 0 if timeout occurred. Returns 0 if bad regexp and @error=1.Therefore, this SHOULD work: If NOT WinWaitClose("whatever") = 1 Then Msgbox(0,"","WinWaitClose FAILED") Kurt Edited January 17, 2007 by _Kurt Awaiting Diablo III..
JohnBailey Posted January 18, 2007 Author Posted January 18, 2007 Well, to quote the helpfile: Therefore, this SHOULD work: If NOT WinWaitClose("whatever") = 1 Then Msgbox(0,"","WinWaitClose FAILED")oÝ÷ Ø««·ú®¢×º»p£!iÙè×!Ê.Ü+×¢¶ØZ¶È¦¦·Üéު笶*'v¬¶æ§Ü(ºW[zX¤y«¢+Ù]¥¹]¥Ñ ±½Í ÅÕ½ÐíÝ¡ÑÙÉAɽɴÅÕ½Ðì°È¤)%9=P]¥¹]¥Ñ ±½Í ÅÕ½ÐíÝ¡ÑÙÉAɽɴÅÕ½Ðì¤ôÄQ¡¸5ͽà À°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðí]¥¹]¥Ñ ±½Í%1ÅÕ½Ðì A decision is a powerful thing
Developers Jos Posted January 18, 2007 Developers Posted January 18, 2007 Well, to quote the helpfile: Therefore, this SHOULD work: If NOT WinWaitClose("whatever") = 1 Then Msgbox(0,"","WinWaitClose FAILED")oÝ÷ Ø««·ú®¢×¥v}ý¶ØZµ·ºÚ"µÍYÕ Ú[ØZ]ÛÜÙJ ][ÝÝÚ]]][ÝÊHHJH[ÙØÞ ][ÝÉ][ÝË ][ÝÕÚ[ØZ]ÛÜÙHRSQ ][ÝÊoÝ÷ ÚãºËZºÚ"µÍYÕÚ[ØZ]ÛÜÙJ ][ÝÝÚ]]][ÝÊH[ÙØÞ ][ÝÉ][ÝË ][ÝÕÚ[ØZ]ÛÜÙHRSQ ][ÝÊ 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.
Developers Jos Posted January 18, 2007 Developers Posted January 18, 2007 Kurt wow I had no idea I could write it that simply! One question does that mean it would be like WinWaitClose("whateverProgram",2) If NOT WinWaitClose("whateverProgram") = 1 Then Msgbox(0,"","WinWaitClose FAILED") 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.
JohnBailey Posted January 18, 2007 Author Posted January 18, 2007 Nope, should be: $rc = WinWaitClose("whateverProgram",2) If NOT $RC Then Msgbox(0,"","WinWaitClose FAILED") THANK YOU A decision is a powerful thing
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