Jump to content
Sign in to follow this  
joetheshadow

IFWINEXISTS Problem

Recommended Posts

joetheshadow

Hi All,

I am a total newbie to AutoIT and am finding it a extremely useful tool however am having trouble with a couple of functions.

Basically I am trying to write a script to do the following;

Copy a modem number from an excel spreadsheet

Open Symantec Procomm

Run a dial script in Procomm

Paste the modem number into the dial no. box

Run a Procomm script once connected

Close the modem connection once the script has completed

Close Promcomm

Go back to the start (ie move onto the next modem no. etc.....

The problem I am having is if the connection to the modem fails I get a different window appear which I want to use as a trigger to move onto the next site on the list (or restart the script). I am trying to use the IFWINEXISTS command but can't seem to get it to work.

If WinExists ("Script Terminated","Data Failed to Retur") Then

send ("{ENTER}")

Run ("C:\Documents and Settings\xxxxxx\Desktop\Auto Startup.exe")

EndIf

I can get the command to display a message box so I know it is seeing the window however for some reason it wont restart the script.

Also is there a sort of GOTO command for AutoIT? Basically I'd like my script to be IF "script terminated" appears then goto line 55 else contine. If that makes sense?

Any help would be really appriciated.

Thanks

Joe

Share this post


Link to post
Share on other sites
Inverted

What does "Auto Startup.exe" do ? Is it the script itself ?

Also, there is no goto command, because good structured programs don't need one :)

Share this post


Link to post
Share on other sites
ksmith247

Check AdlibEnable() to handle your modem failure popup window. If I can find my specific code I will post it.<br><br>OK, I can't locate the post but I asked a similar question concerning the Security Warning that pops up when you run an executable from network locations. I wish I could find the post to give proper credit because this one has saved me.<br><br>Use <br><br>

<br>AdlibEnable("_WinTitle")<br>your code<br>your code<br>AdlibDisable()<br><br>Func _WinTitle()<br>&nbsp;&nbsp;&nbsp; If WinExists("Open File - Security Warning") Then ControlClick("Open File - Security Warning", "", "&amp;Run")<br>EndFunc&nbsp;&nbsp; ;==&gt;_WinTitle<br>
<br><br>You will have to modify the WinExists and ControlClick to whatever your popup window says. <br><br>Hope this helps.<br><br>

Edited by ksmith247

Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]

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  

×