Rustywinger Posted April 4, 2009 Report Share Posted April 4, 2009 So I have this loop that tests if a window exists by setting the boolean to true/false. The dialog box for setting up the 'If Window' Boolean argument allows for two considerations, 'If the window does not exist', and 'if the window is not focused'. Both scenarios would apply to my problem. So I set the target window title using the "browse" button, with partial match criteria. If the specified window does not exist, then it should return true to the WindExists Variable. The loop agrument is waiting for WindExists == TRUE. Howeeeeeever.... I start the loop up, then close the target window as a test. The macro keeps merrily looping away. What gives? The Boolean value being sent to WindExists Variable is remaining FALSE despite the fact the window is gone and it should return TRUE? The program in question is a java program called Image Viewer. Other macro commands work for this, such as the 'Wait for window title to lose focus'. No problem with that, however, this isn't how I want to set up the detection process, and I shouldn't have to given the boolean test loop SHOULD work. Any ideas from the smarter crowd? <REPEAT UNTIL Variable="%WindExist%" Condition="\x00" Value="TRUE"/> <VARIABLE SET BOOL Destination="%WindExist%" Command="148" Option="\x01" Title="Image Viewer" Partial="TRUE" Wildcards="FALSE"/> <END REPEAT/> <TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 Window is GONE, GONE, GONE!\r\n\\par %WindExist%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> Quote Link to comment Share on other sites More sharing options...
Cory Posted April 4, 2009 Report Share Posted April 4, 2009 <VARIABLE SET BOOL Destination="%WindExist%" Command="148" Option="\x01" Title="Image Viewer" Partial="TRUE" Wildcards="FALSE"/> This appears to be broken and you should report it to ISS as a bug. I opened Notepad and ran this command and it come s back as True and it should be False. Unless I'm really missing something here. Quote Link to comment Share on other sites More sharing options...
Cory Posted April 4, 2009 Report Share Posted April 4, 2009 Almost forgot. You should insert at least some small delay in your loop. 200mS should work. BTW: don't' try and disable the first line in your script. For me it crashes the scripting editor every time. Quote Link to comment Share on other sites More sharing options...
Rustywinger Posted April 4, 2009 Author Report Share Posted April 4, 2009 Okey doke, I sent along a bug report regarding this, I know I should have the delay... was just lazy. Delay was in the main macro but not in the smaller test macro I set up to try and troubleshoot this issue. BTW: don't' try and disable the first line in your script. For me it crashes the scripting editor every time. Hey, was this just unrelated advice or something you saw in the code/post I submitted? I am leaning towards the former in which case, good to know... haha Quote Link to comment Share on other sites More sharing options...
Cory Posted April 5, 2009 Report Share Posted April 5, 2009 Hey, was this just unrelated advice or something you saw in the code/post I submitted? I am leaning towards the former in which case, good to know... hahaI discovered it while testing your macro so it's not really related to the bug you found but something else. However it is 'related' in that you might have run into the same issue. Quote Link to comment Share on other sites More sharing options...
kevin Posted April 6, 2009 Report Share Posted April 6, 2009 BTW: don't' try and disable the first line in your script. For me it crashes the scripting editor every time. Cory, this never fails for me. Please send the crash report and a sample macro. Quote Link to comment Share on other sites More sharing options...
Cory Posted April 6, 2009 Report Share Posted April 6, 2009 Cory, this never fails for me. Please send the crash report and a sample macro. Wilco Quote Link to comment Share on other sites More sharing options...
stevecasper Posted April 8, 2009 Report Share Posted April 8, 2009 Almost forgot. You should insert at least some small delay in your loop. 200mS should work. BTW: don't' try and disable the first line in your script. For me it crashes the scripting editor every time. Hey Cory, I've ahd the same experience (just once, and thought it had something to do with the particular command). If you get me the bug report number, I'll submit my example referencing it. Quote Link to comment Share on other sites More sharing options...
Cory Posted April 9, 2009 Report Share Posted April 9, 2009 6793 http://bluepointdesign.com/macros/Issues/6793/ Quote Link to comment Share on other sites More sharing options...
stevecasper Posted April 9, 2009 Report Share Posted April 9, 2009 6793http://bluepointdesign.com/macros/Issues/6793/ Great, thanks Cory. Just a heads-up to everybody else who might read this: The crash happens when disabling the "Repeat Start" line of a Repeat Loop, but seems to only happen when the Start is on Line 1. I'm putting that into the bug report as well. Quote Link to comment Share on other sites More sharing options...
terrypin Posted April 12, 2009 Report Share Posted April 12, 2009 <VARIABLE SET BOOL Destination="%WindExist%" Command="148" Option="\x01" Title="Image Viewer" Partial="TRUE" Wildcards="FALSE"/> This appears to be broken and you should report it to ISS as a bug. I opened Notepad and ran this command and it come s back as True and it should be False. Unless I'm really missing something here. I get the same. It seems that it's reversed. (Maybe so for other entries too.) I also don't see why the command is designed (for example) to return TRUE for If the Window Does Not Exist, which seems counter-intuitive to me. BTW, while working on this simple macro, I managed to lose the command dialog box. So that when I returned to Script Editor (from composing this message in Firefox) it was as if ME Pro had frozen. It was exactly the same as I described in a separate post earlier today, http://pgmacros.invisionzone.com/index.php?showtopic=3788 -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
stevecasper Posted April 13, 2009 Report Share Posted April 13, 2009 Great, thanks Cory. Just a heads-up to everybody else who might read this: The crash happens when disabling the "Repeat Start" line of a Repeat Loop, but seems to only happen when the Start is on Line 1. I'm putting that into the bug report as well. Not to beat a dead horse, but since I've already got the club drawn... I just had this crash when disabling an If command. So it's apparently not limited to Repeat loops, but potentially any set of commands that have a start and end to them (I have not attempted it with a Text File Process, but it looks like this may also cause a crash. I'll test it and post an Edit. EDIT Confirmed: The crash occurs with both Text File Process and ASCII File Process commands. Quote Link to comment Share on other sites More sharing options...
Cory Posted April 13, 2009 Report Share Posted April 13, 2009 That's really good to know, I'm glad you spotted it. Quote Link to comment Share on other sites More sharing options...
Rustywinger Posted April 17, 2009 Author Report Share Posted April 17, 2009 I also don't see why the command is designed (for example) to return TRUE for If the Window Does Not Exist, which seems counter-intuitive to me. Programming Semantics! :-) IF NOT EXISTS and TRUE were simply the default setting in the Boolean setup box, so I went with that, it was a simple test in a little loop. I just knew it would work anyhow and this is just a case of function trumping form! lol! Maybe for a future release, all 'IF NOT' BOOLEAN conditions should change the default value to 'FALSE'? 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.