AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How can we tell whether all scripts line have executed??

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
ansu832001



Joined: 05 May 2008
Posts: 18

PostPosted: Wed May 07, 2008 11:56 am    Post subject: How can we tell whether all scripts line have executed?? Reply with quote

Hi All,

I have a script with few lines of code when i run this script because of some reasons all the line of script doesn't execute,so how can i know how many line has been executed and when script fails executing all lines i should be able to handle it by executing other script.

Best Regards.
Back to top
View user's profile Send private message
sinkfaze



Joined: 18 Mar 2008
Posts: 139

PostPosted: Wed May 07, 2008 1:09 pm    Post subject: Reply with quote

Either double-click on the Authotkey icon in the tray and select View -> Key History & Script Info and View -> Lines Most Recently Executed to see what the script has executed.

You can also post your code here in the forum so we can take a look at it and let you know if there's something that may not be set to execute correctly.
Back to top
View user's profile Send private message
ansu832001



Joined: 05 May 2008
Posts: 18

PostPosted: Wed May 07, 2008 1:41 pm    Post subject: Reply with quote

Hi sinkfaze,
firstly thanks for your reply , my question is something like this

In my Application i have a textbox, when we enter value in it it checks in database whether this entered value is unique or not(like Code number).if unique i continue with further operations.

Now,I record a script,
I enter a value in it(which is unique) then i perform other operations.
and when i rerun this script i takes the same value and enters in the textbox,this time it is duplicate so in this case i get a Validation,from here iam unable to go further,so my basic flow of script is disturbed .

I want to handle this scenario and log some message saying script failed.

I hope you get me.

Best Regards,
Back to top
View user's profile Send private message
sinkfaze



Joined: 18 Mar 2008
Posts: 139

PostPosted: Wed May 07, 2008 1:57 pm    Post subject: Reply with quote

ansu832001 wrote:
In my Application i have a textbox, when we enter value in it it checks in database whether this entered value is unique or not(like Code number).if unique i continue with further operations.

Now,I record a script, I enter a value in it(which is unique) then i perform other operations and when i rerun this script i takes the same value and enters in the textbox. this time it is duplicate so in this case i get a Validation,from here i am unable to go further,so my basic flow of script is disturbed.

I want to handle this scenario and log some message saying script failed.

I hope you get me.

Best Regards,


Since I can't see your script I can't see what exactly is occurring so all I can do is give you ideas on where to look.

Is the textbox in its own separate window? Or is it a textbox emdedded in the program? If it's in a separate window that disappears when you've successfully entered a unique entry you can add a line like WinWaitClose to your script and tell the script wait for that window to close before proceeding.

If the Validation warning is its own separate window you can use IfWinExist to search for the window after you've input the text and do a loop like this:

Code:
Send [whatever your text is]{ENTER}
Sleep, 1000 ; you can optionally create a delay before entering the loop in order to give the window time to appear
Loop
IfWinExist Validation Error
{
 continue
}
else
{
 [the rest of your script here]
 return
}
Back to top
View user's profile Send private message
ansu832001



Joined: 05 May 2008
Posts: 18

PostPosted: Thu May 08, 2008 4:53 am    Post subject: Reply with quote

Thanks Sinkfaze,

With your suggestion i atleast got some idea on how to deal with it

Best Regards.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group