Hi Logan, - depending on how the app behaves, it may be better to always set the cursor to the non dynamic position following the closing of the input box, then use the if statements to determine where to set it next, as it will then always be moving from the non dynamic position. - this way the Count variable may not be required at all... Perhaps something like this: InputBox ("Where To?: ", "Navigation Box", sFindThis ) Pause () ; time for the InputBox to close, & the screen to settle MoveTo (1, 1) LeftMouse () ;moves away from the dynamic area and performs a left click Pause () ; now the if statements... If sFindThis = "Coy" Then MoveTo (683, 387) ... Regards, Paul from Aust ----- Original Message ----- From: "Logan McMullen" <loganmcmullen@xxxxxxxxxxxxxxx> To: "Jaws Scripting List" <jawsscripts@xxxxxxxxxxxxx> Sent: Tuesday, June 30, 2009 4:19 PM Subject: [jawsscripts] Using an counter variable in an If Loop Hi, I'm creating a script which has a nested If statement. When the script fires it offers the user an input box ..the inputted string becomes a stored variable that then actions other user defined functions or moves to a location on the current page. This input box will be used by the person to get to a number of locations...so may be used a number of times within the same window/session. The locations on the same page are dynamic fields that I have identified and have got the required cursor moving to...however once one of these fields has been clicked on and activated the mouse must be clicked out of the dynamic area before being moved to another of these fields. My solution has been to create an int variable that acts as a counter for the script; the script can check if it has been actioned before by looking at the counter value and if it hasn't it can move directly to one of the dynamic fields..but if the value is not nul or 0 it would then perform the click out of the area action before going on with the move to command. My question is: How do I make the Int counter work so that I can use it as a variable to check ? The first If statement of my script currently reads like this: var String sFindThis, Int iCount ; String is the variable to search on from the input box ; Int is a counter for the If Statement InputBox ("Where To?: ", "Navigation Box", sFindThis ) ; Displays a dialogue box for user to enter a location ; Can be actioned in any of the areas worked in if required If sFindThis = "Coy" && iCount = 0 Then MoveTo (683, 387) LeftMouse () ; Moves to and clicks on the Coy No field Let iCount =1 ; Makes the counter 1 Will this statement work if it is followed by an ElIf statement such as: If sFindThis = "Coy" && iCount =! 0 Then MoveTo (1, 1) LeftMouse () ;moves away from the dynamic area and performs a left click Pause () MoveTo (683, 387) LeftMouse () ; Moves to and clicks on the Coy No field There are a number of these fields that the user might want to activate one after another so if this won't work, does anyone have any ideas? Cheers Logan __________ Visit and contribute to The JAWS Script Repository http://jawsscripts.com View the list's information and change your settings at //www.freelists.org/list/jawsscripts __________ Visit and contribute to The JAWS Script Repository http://jawsscripts.com View the list's information and change your settings at //www.freelists.org/list/jawsscripts