shx Posted December 11, 2005 Share Posted December 11, 2005 Hi, I am just getting into this great product and any help is appreciated. Commands that have a timeout parameter like "WinWaitActive" what happens if the timeout is exceeded and it goes to the next line of code. Is there a variable set that can be looked at ot a function/routine that can be invoked? Also is there any sort of debug or logging that the scripts can do while executing? Where in the help file can I find these type of issues? TIA Steven Link to comment Share on other sites More sharing options...
BigDod Posted December 11, 2005 Share Posted December 11, 2005 Hi,I am just getting into this great product and any help is appreciated.Commands that have a timeout parameter like "WinWaitActive" what happens if the timeout is exceeded and it goes to the next line of code.Is there a variable set that can be looked at ot a function/routine that can be invoked?Also is there any sort of debug or logging that the scripts can do while executing?Where in the help file can I find these type of issues?TIAStevenWinWaitActive if used without a timeout will wait until the window becomes active. (see help file example)The search part of the help file should help with most issues you have.If the help file does not answer your question then post here including a sample script showing what you have tried. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
shx Posted December 11, 2005 Author Share Posted December 11, 2005 WinWaitActive if used without a timeout will wait until the window becomes active. (see help file example)The search part of the help file should help with most issues you have.If the help file does not answer your question then post here including a sample script showing what you have tried.Thanks,I want to use the timeout parameter. I'm just not certain of how do you determine if the event actually occured or if the timeout was exceeded.Steven Link to comment Share on other sites More sharing options...
JSThePatriot Posted December 11, 2005 Share Posted December 11, 2005 Hi, I am just getting into this great product and any help is appreciated. Commands that have a timeout parameter like "WinWaitActive" what happens if the timeout is exceeded and it goes to the next line of code. Is there a variable set that can be looked at ot a function/routine that can be invoked? Also is there any sort of debug or logging that the scripts can do while executing? Where in the help file can I find these type of issues? TIA Steven Search the helpfile for the @error macro. It should help you with error checking. As well as each function returns a value based on whether or not it was sucessful. In WinWaitActive()'s case it will return 0 upon failure/timeout. In the helpfile this is under the Return Value section. So you could do something like the following... $timeout = WinWaitActive("SomeWindow", "", 2);times out after 2 seconds If $timeout = 0 Then MsgBox(0, "DEBUG", "Window timed out. Please contact the program administrator.") The helpfile is one of the best compiled helpfiles I have ever seen. I even think it is good enough to model other helpfiles after. I am currently working on a project relating to AutoIt that needs a helpfile and it is a great inspiration looking at AutoIt's. Let me know if there is anything else I can answer/do for you. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
shx Posted December 11, 2005 Author Share Posted December 11, 2005 Let me know if there is anything else I can answer/do for you.JSOK thanks, this works fine.Now my question is that I am using autoit via vbscript and I want to return the $timeout value to the vbscript. Can you help me this or should I post it in the autoit activex forum.ThanksSteven Link to comment Share on other sites More sharing options...
JSThePatriot Posted December 11, 2005 Share Posted December 11, 2005 Hrm... someone just posted a topic on this. You can always write the value to a file and read it out that way. I am currently searching the helpfile to see if there is a better way. Like having the script return a variable. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
seandisanti Posted December 12, 2005 Share Posted December 12, 2005 OK thanks, this works fine.Now my question is that I am using autoit via vbscript and I want to return the $timeout value to the vbscript. Can you help me this or should I post it in the autoit activex forum.ThanksStevenIf you mean you have a vb script that's calling an exe, then you have to do your programming in your vbscript to read whatever output you generate with your autoit script. text file, ini, registry settings, environment variables etc. a plain text file is probably the second easiest way, next to doing everything in autoit. Or if you really want to make even more work than you have to, you could have your vbscript pop up input boxes for the values, and have the autoit script populate and submit the values that way... Link to comment Share on other sites More sharing options...
shx Posted December 12, 2005 Author Share Posted December 12, 2005 If you mean you have a vb script that's calling an exe, then you have to do your programming in your vbscript to read whatever output you generate with your autoit script. text file, ini, registry settings, environment variables etc. a plain text file is probably the second easiest way, next to doing everything in autoit. Or if you really want to make even more work than you have to, you could have your vbscript pop up input boxes for the values, and have the autoit script populate and submit the values that way...I mean that I am using AutoItX Steven Link to comment Share on other sites More sharing options...
seandisanti Posted December 12, 2005 Share Posted December 12, 2005 I mean that I am using AutoItX Stevenok neat. Code please? Link to comment Share on other sites More sharing options...
shx Posted December 13, 2005 Author Share Posted December 13, 2005 Dim oShellDim oAutoItDim xResult''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Initialise Variables & Objects''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''Set oShell = WScript.CreateObject("WScript.Shell")Set oAutoIt = WScript.CreateObject("AutoItX3.Control")''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Start of Script''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''WScript.Echo "This script will run notepad and type in some text"oShell.Run "notepad.exe", 1, FALSE' Wait for the Notepad window to become activeoAutoIt.WinWaitActive "Untitled - Notepad","", "9"this will work. but i am looking for a way for the vbscript to know if the timeout has been exceeded.Steven 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