jazs Posted March 14, 2007 Posted March 14, 2007 I am writing a code to run of of my programs that I run on a daily basis and I am having problems with the initresponse. The box that is supposed to pop up is a yes or no box.. If you answer yes then it is supposed to select yes, if you select no then it is supposed to send an {ESC} keystroke.. The good part it I have the {ESC} part working on the later init response. In the first initresponse the yes works but not the now.. If someone could help it would be apreciated. Below is the code that I am using... Thanks in advance $intResponse=MsgBox(4, "Close The GL", "Close the General Ledger?") if $intResponse=2 then send("{ENTER}") else send("{LEFT}") send("{ENTER}") Endif send("{ENTER}") sleep(1000) send("{ENTER}") sleep(1000) send("{ENTER}") sleep(2000) $intResponse=MsgBox(4, "Schedule Goodnight", "Schedule Goodnight?") if $intResponse=1 then send("{ENTER}") else send("{ESCAPE}") endif sleep(1000) send("{ENTER}")
Lemmens Peter Posted March 14, 2007 Posted March 14, 2007 Your problem is that the answer to the MsgBox is not correct It must be : if you answer YES => $intResponse = 6 if you answer NO => $intResponse = 7Good luck,PeterDim $intResponse; 4096 System modal (dialog has an icon); 4 Yes and No; 32 Question-mark icon $intResponse = MsgBox(4096 + 4 + 32, "Close The GL", "Close the General Ledger?")If $intResponse = 6 Then ; Put script here that will be executed when you answer "yes"Else ; Put script here that will be executed when you answer "No"EndIf
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