Sign in to follow this  
Followers 0
shx

Newbie questions

10 posts in this topic

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

Share this post


Link to post
Share on other sites



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

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.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

Let me know if there is anything else I can answer/do for you.

JS

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.

Thanks

Steven

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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.

Thanks

Steven

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...

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

I mean that I am using AutoItX

Steven

ok neat. Code please?


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Dim oShell

Dim oAutoIt

Dim 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 active

oAutoIt.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

Share this post


Link to post
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
Sign in to follow this  
Followers 0