tpiper Posted May 8, 2009 Report Share Posted May 8, 2009 I have a situation that requires that a window remains open if the user hits “yes” and closes either if they hit “no”, or if nothing is typed into the If Message dialog box within a certain length of time. I can make this work if the default button is “no”, but the user wants the default to be yes so that they don’t inadvertently close the program by hitting enter. I’ve also tried inserting an If Window on Top command to look for the IF Message dialog box still being open after "X" seconds but that didn't work either. I know there’s probably a simple solution but I’m fairly new at this and can’t seem to get my head around the logic. Also, is there possibly another way to go beside using the If Message dialog box? Thanks for any help! Tom Quote Link to comment Share on other sites More sharing options...
kevin Posted May 8, 2009 Report Share Posted May 8, 2009 If I understand correctly then you want something like this: Activate or Launch: "notepad" OR "notepad.exe" Wait For Window Title: "notepad" If Message: "Do you want to leave Notepad open?" Else Window Close: "notepad" End If Copy this code and paste it into a new macro: <LAUNCHYES3:0:0112notepad<LAUNCH:notepad.exe><WAITWIN2:000010:000000:notepad><REM2:><IFMESS3:00005:1:1:Do you want to leave Notepad open?Do you want to leave Notepad open?Center:Center><ELSE><WCLS:notepad><ENDIF> Quote Link to comment Share on other sites More sharing options...
tpiper Posted May 8, 2009 Author Report Share Posted May 8, 2009 Kevin, yes except I also need the window to close if there is no user response at all. Tom If I understand correctly then you want something like this:Activate or Launch: "notepad" OR "notepad.exe" Wait For Window Title: "notepad" If Message: "Do you want to leave Notepad open?" Else Window Close: "notepad" End If Copy this code and paste it into a new macro: <LAUNCHYES3:0:0112notepad<LAUNCH:notepad.exe><WAITWIN2:000010:000000:notepad><REM2:><IFMESS3:00005:1:1:Do you want to leave Notepad open?Do you want to leave Notepad open?Center:Center><ELSE><WCLS:notepad><ENDIF> Quote Link to comment Share on other sites More sharing options...
kevin Posted May 8, 2009 Report Share Posted May 8, 2009 I see now. You want the default button to be different than the default action if they do nothing. No, I don't see how to do that either. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.