rick Posted October 2, 2009 Report Share Posted October 2, 2009 As you may be aware, the commands in MEP comes with an On Error tab, and the Help says that Halt Macro is the most likely choice/option. With the following: Wait for Key Press: ENTER If I set the "The condition was not met within the specified amount of time" error to Halt Macro, I get a dialog saying there's a Script Error. I can't find anything in the preferences to turn the dialog off completely (there's an option to automatically cancel it). The alternative seems to be to follow the previous code with: On Error Catch Error: The condition was not met within the specified amount of time Macro Stop End Catch Error End Error Is there a better way than dotting code with these On Error - End Error sequences? For example, in Visual Basic (not that I'm any expert), you can put error handlers at the end of the code using Labels, and GoTo after On Error code. Also, can you nest a series of Catch Error commands before an End Catch? TIA Rick Quote Link to comment Share on other sites More sharing options...
terrypin Posted October 2, 2009 Report Share Posted October 2, 2009 Seems to work OK here. My macro is the single command Wait for Key Press: ENTER with the code <WAIT FOR KEY PRESS Key="ENTER" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> How are you activating it? Presumably it doesn't involve using the Enter key? (If it does, for example if you're running it from Script Editor, then precede the command with a 1 second delay.) When do you get this "...dialog saying there's a Script Error"? When writing or running the macro? If you post a (short!) section of code from Direct Editor that's exhibiting this behaviour, we could try it. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
rick Posted October 2, 2009 Author Report Share Posted October 2, 2009 Hi, I get the dialog when I run the macro which I activate by a Hotkey, and if I allow the time delay for the "key press" to run out (10 sec when testing, 120 sec when I finally get it right). Heres the sample: <TEXT TYPE Action="0" Text="<ALT>sct"/> <WAIT FOR TEXT PLAYBACK Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> <WAIT FOR KEY PRESS Key="ENTER" Indefinite="FALSE" Hours="0" Minutes="0" Seconds="120" _HANDLE="0x0014"/> <ON ERROR/> <CATCH ERROR Code="20"/> <MACRO STOP/> <END CATCH ERROR/> <END ERROR/> TIA Rick How are you activating it? Presumably it doesn't involve using the Enter key? (If it does, for example if you're running it from Script Editor, then precede the command with a 1 second delay.) When do you get this "...dialog saying there's a Script Error"? When writing or running the macro? If you post a (short!) section of code from Direct Editor that's exhibiting this behaviour, we could try it. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
terrypin Posted October 2, 2009 Report Share Posted October 2, 2009 Hi, I get the dialog when I run the macro which I activate by a Hotkey, and if I allow the time delay for the "key press" to run out (10 sec when testing, 120 sec when I finally get it right). Heres the sample: <TEXT TYPE Action="0" Text="<ALT>sct"/> <WAIT FOR TEXT PLAYBACK Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> <WAIT FOR KEY PRESS Key="ENTER" Indefinite="FALSE" Hours="0" Minutes="0" Seconds="120" _HANDLE="0x0014"/> <ON ERROR/> <CATCH ERROR Code="20"/> <MACRO STOP/> <END CATCH ERROR/> <END ERROR/> TIA Rick I can't say I really follow what you're trying to do there! But anyway hw can it work as it stands with that Macro Stop in place? Essentially your macro really looks like this: Text Type (Simulate Keystrokes): <ALT>sct Wait for Text Playback Wait for Key Press: ENTER On Error Catch Error: The condition was not met within the specified amount of time So that breaks the rule for the On Error command having to be paired with an End Error. Can you explain exactly what you want to happen? -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
Cory Posted October 2, 2009 Report Share Posted October 2, 2009 If I understand you correctly your goal isn't so much to handle errors but rather avoid seeing the Scrip Error messages. If I have that wrong let me know. I was looking into logging errors and found a few things you might want to check out. I don't know how well they work so take this with a grain of salt. In the Log Errors command you can log to a file and there is a check box to not display the error message to the user. In the MEP options there is a command to clear errors after a time. Preferences > Playback > Miscellaneous Clear error messages after X seconds. I don't know if you can combine the On Error and Catch Error sets. The help file shows a simplified example. But it would be easy enough to test. Simply create a set of commands to divide by zero or something like I did in my other post and make a few combinations. Finally if there are potential areas for problems do tests instead. EG verify that the denominator is not zero or make sure the file is ready. Normal programming practices really. Let us know what you find out, I'd love to know but i don't have time to test them myself right now. Quote Link to comment Share on other sites More sharing options...
rick Posted October 7, 2009 Author Report Share Posted October 7, 2009 Hi Cory, Sorry to take so long to reply - been busy also. If I understand you correctly your goal isn't so much to handle errors but rather avoid seeing the Scrip Error messages. If I have that wrong let me know. My goal is both really. I don't really see the point of having the error handling options built into all the commands if you then need to dot your code with these "On Error - End Error" sequences. That's why say "Maybe I'm not getting it". Is there something I'm not understanding about this, such as a more efficient way to write the code? Certainly, with the example I give there's no point in having a Script Error dialog come up if I've written code to handle it! I was looking into logging errors and found a few things you might want to check out. I don't know how well they work so take this with a grain of salt. In the Log Errors command you can log to a file and there is a check box to not display the error message to the user. In the MEP options there is a command to clear errors after a time. Preferences > Playback > Miscellaneous Clear error messages after X seconds. The first option sounds like the solution, I'll try it! I thought of the second but it's too global, and still doesn't stop the Script Error dialog. I don't know if you can combine the On Error and Catch Error sets. The help file shows a simplified example.Yes... I don't think the Help explains it very well here, compared to rest which I usually find very good. But it would be easy enough to test. Simply create a set of commands to divide by zero or something like I did in my other post and make a few combinations. Finally if there are potential areas for problems do tests instead. EG verify that the denominator is not zero or make sure the file is ready. Normal programming practices really.Believe me ... tested the c*!p out this. Usually find works better in the morning than 12 MN tho'. Let us know what you find out, I'd love to know but i don't have time to test them myself right now. Will do. Thanks for your helpful comments Quote Link to comment Share on other sites More sharing options...
rick Posted October 7, 2009 Author Report Share Posted October 7, 2009 Can you explain exactly what you want to happen?What is supposed to happen is this:The macro pauses waiting for the ENTER key. If that doesn't occur after 120 seconds, I want the macro to halt without the Script Error dialog coming up. So far, the only method I've found to do this is to handle the error as I've shown. It works. But I find it an odd way to write code with all these "On-Error End-Error" sequences through it .... I can't say I really follow what you're trying to do there! But anyway hw can it work as it stands with that Macro Stop in place? Essentially your macro really looks like this:Text Type (Simulate Keystrokes): <ALT>sct Wait for Text Playback Wait for Key Press: ENTER On Error Catch Error: The condition was not met within the specified amount of time So that breaks the rule for the On Error command having to be paired with an End Error. You're absolutely correct!When I check the error log for which commands have been run this is what I see: Line 31: Wait for Key Press The condition was not met within the specified amount of time Line 32: On Error Line 33: Catch Error Line 34: Macro Stop The 2 commands "End Catch Error" and 'End Error' can't run, but does it matter? The Macro is supposed to Stop. I don't know ... I don't understand a lot of this. Rick. Quote Link to comment Share on other sites More sharing options...
terrypin Posted October 7, 2009 Report Share Posted October 7, 2009 What is supposed to happen is this:The macro pauses waiting for the ENTER key. If that doesn't occur after 120 seconds, I want the macro to halt without the Script Error dialog coming up. So far, the only method I've found to do this is to handle the error as I've shown. It works. But I find it an odd way to write code with all these "On-Error End-Error" sequences through it .... You're absolutely correct! When I check the error log for which commands have been run this is what I see: Line 31: Wait for Key Press The condition was not met within the specified amount of time Line 32: On Error Line 33: Catch Error Line 34: Macro Stop The 2 commands "End Catch Error" and 'End Error' can't run, but does it matter? The Macro is supposed to Stop. I don't know ... I don't understand a lot of this. Rick. OK, I follow you now. I think it implies two bugs in ME Pro. To make the discussion more accessible I've modified your example as follows: 1. I have no idea what window that Text Type <ALT>sct command is supposed to type into or what it's supposed to do. But it seems irrelevant to the current discussion so I've removed it and its associated Wait command. 2. I've ignored the On Error stuff, because I agree with you: that should be unnecessary if the Wait for Key Press: ENTER works properly // I'll use a window we can all access, Notepad. Activate or Launch: Window "Notepad", Program "NOTEPAD.EXE", Parameters "" Wait for Window Title: Notepad Wait for Key Press: ENTER // My version: set to HALT MACRO if time exceeds 5 seconds <COMMENT Value="I'll use a window we can all access, Notepad."/> <ACTIVATE OR LAUNCH Title="Notepad" Exact_Match="FALSE" Wildcards="FALSE" Path="C:\\WINDOWS\\NOTEPAD.EXE" Mode="\x00" Default_Path="TRUE" Wait="1" Wait_For_Program="12" _IGNORE="0x0006"/> <WAIT FOR WINDOW TITLE Title="Notepad" Partial="TRUE" Wildcards="FALSE" Indefinite="FALSE" Hours="0" Minutes="0" Seconds="2" _PROMPT="0x0014"/> <WAIT FOR KEY PRESS Key="ENTER" Indefinite="FALSE" Hours="0" Minutes="0" Seconds="5" _COMMENT="My version: set to HALT MACRO if time exceeds 5 seconds"/> Unless I'm making some basic slip (wouldn't be the first time!) then my macro should simply open Notepad and if I press the Enter key within 5 seconds it should do so (moving down a line in Notepad) and immediately stop. If I take longer, then after no action in Notepad it should stop, with no messages. But it fails in both scenarios, implying two separate bugs: If I immediately type Enter, Notepad correctly moves down a line but the macro continues, and then displays an error message "The following error was encountered: The condition was not met within the specified amount of time." If instead I do not type Enter at all, after 5 seconds or so the same error message appears. To explain the appearance of the message (one of the two bugs implied) I thought maybe there might be a setting somewhere that would enable/disable the message when a macro was halted. The only potentially relevant setting I could find was Options > Preferences > General > Dialogs > Inform the user when a macro has been cancelled which is not enabled. Hopefully we might get some advice from ISS, whom I've also emailed. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
paul Posted October 7, 2009 Report Share Posted October 7, 2009 I don't see a problem! Here'a macro that waits for up to 5 seconds for the letter "a" to be pressed. If the letter is pressed, a message is displayed to that effect. If the letter isn't pressed, the macro stops without displaying any message. <WAIT FOR KEY PRESS Key="A" Indefinite="FALSE" Hours="0" Minutes="0" Seconds="5" _HANDLE="0x0014"/> <ON ERROR/> <CATCH ERROR Code="20"/> <MACRO STOP/> <END CATCH ERROR/> <END ERROR/> <TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\lang3081\\f0\\fs16 A was pressed within 5 seconds\\lang1033\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="1" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> In English: Wait for Key Press: A (The On Error tab is set to "Handle Error" for the first error code shown) On Error Catch Error: The condition was not met within the specified amount of time Macro Stop End Catch Error End Error Text Box Display: (A was pressed within 5 seconds) Quote Link to comment Share on other sites More sharing options...
Cory Posted October 7, 2009 Report Share Posted October 7, 2009 Something obvious just occurred to me. The reason for the two pairs On Error and Catch Error is that you could have multiple errors you would like to handle. A bit of a forehead slap to my chagrin. And I appreciate that it's at minimum 5 extra lines of code but it's simple, intuitive (if you think of it like any other logic condition set) and shouldn't add anything to the overall run time of the macro. Don't forget you can use your snippets to create a On Error group. Quote Link to comment Share on other sites More sharing options...
terrypin Posted October 7, 2009 Report Share Posted October 7, 2009 Something obvious just occurred to me. The reason for the two pairs On Error and Catch Error is that you could have multiple errors you would like to handle. A bit of a forehead slap to my chagrin. And I appreciate that it's at minimum 5 extra lines of code but it's simple, intuitive (if you think of it like any other logic condition set) and shouldn't add anything to the overall run time of the macro. Don't forget you can use your snippets to create a On Error group. Paul, Cory: Can you try my code and tell me what happens please, as I still don't see why that is correct behaviour. In particular, why doesn't the macro stop immediately (with no message) when I hit Enter at once? -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
Cory Posted October 7, 2009 Report Share Posted October 7, 2009 I'm having a tough time understanding what you're on about and unfortunately I need to get back to work. I'll try to come back to it later. But I will tell you that in my system when I run the macro if I hit enter per your instructions the enter appears in Notepad and the macro immediately stops with no errors. If I do not he enter I get a line 4 error. This is exactly how I would expect it to behave. Quote Link to comment Share on other sites More sharing options...
terrypin Posted October 7, 2009 Report Share Posted October 7, 2009 I'm having a tough time understanding what you're on about and unfortunately I need to get back to work. I'll try to come back to it later. But I will tell you that in my system when I run the macro if I hit enter per your instructions the enter appears in Notepad and the macro immediately stops with no errors. If I do not he enter I get a line 4 error. This is exactly how I would expect it to behave. OK, there's one obvious difference then. As I said, in my case hitting Enter at once does not stop the macro. It continues, and then displays the error message when the 5 seconsds is up. Very strange that it should differ from yours. But nor do I see why would you expect a line 4 error if you don't hit Enter. Surely the command Wait for Key Press: ENTER // My version: set to HALT MACRO if time exceeds 5 seconds should simply stop the macro after 5 seconds? Why should it give a message, given that the setting I described is disabled? -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
paul Posted October 7, 2009 Report Share Posted October 7, 2009 Paul, Cory: Can you try my code and tell me what happens please, as I still don't see why that is correct behaviour. In particular, why doesn't the macro stop immediately (with no message) when I hit Enter at once? 1) Not hittng the Enter key within 5 seconds: - If I run your macro from a hotkey, I get a Script Error about the condition not being met within the specified amount of time. - If I run your macro with F9, I get a debug error message to the same effect. 2) Hitting the Enter key within 5 seconds: - Error message continues to appear When I disabled the 2 Notepad lines, it still didn't work. Changing the Enter to Shift also didn't work. Changing the Shift to Tab did work. Changing the Tab back to Shift did work. Changing the Shift to Enter did work. Re-enabling the Notepad lines stopped it working again. Re-disabling the Notepad lines allowed it to work again. There are clearly several problems occurring. Before reporting the problem, you should try replacing Notepad with a few other different types of program - this might help isolate the aberrant behaviour. Quote Link to comment Share on other sites More sharing options...
terrypin Posted October 7, 2009 Report Share Posted October 7, 2009 1) Not hittng the Enter key within 5 seconds:- If I run your macro from a hotkey, I get a Script Error about the condition not being met within the specified amount of time. - If I run your macro with F9, I get a debug error message to the same effect. 2) Hitting the Enter key within 5 seconds: - Error message continues to appear When I disabled the 2 Notepad lines, it still didn't work. Changing the Enter to Shift also didn't work. Changing the Shift to Tab did work. Changing the Tab back to Shift did work. Changing the Shift to Enter did work. Re-enabling the Notepad lines stopped it working again. Re-disabling the Notepad lines allowed it to work again. There are clearly several problems occurring. Before reporting the problem, you should try replacing Notepad with a few other different types of program - this might help isolate the aberrant behaviour. Thanks Paul. I'll take another look at it tomorrow. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
Cory Posted October 7, 2009 Report Share Posted October 7, 2009 But nor do I see why would you expect a line 4 error if you don't hit Enter. Surely the command Wait for Key Press: ENTER // My version: set to HALT MACRO if time exceeds 5 seconds should simply stop the macro after 5 seconds? Why should it give a message, given that the setting I described is disabled?As far as I know the only way you can have a command execution error and not get a box to pop up is if you handle the error. I believe the preference you mentioned is only applies if the user cancels the macro. EG I hit the abort hotkey or clicked on Forrest in the system tray. IE it does not pertain to command errors. Quote Link to comment Share on other sites More sharing options...
terrypin Posted October 8, 2009 Report Share Posted October 8, 2009 Further tests reproduced results similar to those reported earlier. Bugs IMO! Duly reported as such, and it's been assigned the tracking number [iSS7579]. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
rick Posted October 9, 2009 Author Report Share Posted October 9, 2009 Curious to know what the error log shows if you log all commands - do all the commands actually run? Don't know about you all, but I find this error logging feature useful in pointing out where my code goes pear-shaped (pretty often really.... ) Also, just to confirm, that for me, in my original macro the only 2 ways to stop that pesky Script Error dialog was: Handle the error with an On-Error - End Error sequence. Use a Log Error command with the option to suppress error messages, but the macro continues unless the error is handled. I would have thought the idea of putting error handling such as "Halt Macro" in the actual commands was to avoid having to use On-Error sequences just to stop a macro with about another 5 lines of code (seems inefficient to me - but I'm only a user ). So, I tend to agree ... bug rather than feature! Thanks for your hard work on this guys. Further tests reproduced results similar to those reported earlier. Bugs IMO! Duly reported as such, and it's been assigned the tracking number [iSS7579]. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
rick Posted October 9, 2009 Author Report Share Posted October 9, 2009 Do you mean that you think you can nest multiple Catch Error commands inside the End Error commands thus: On Error Catch Error: Control doesn't exist Goto:Do something or other End Catch Error Catch Error: The file could not be opened Goto:Do sumthing else End Catch Error Catch Error: The path does not exist Goto:Give up & go home End Catch Error Catch Error: The condition was not met within the specified amount of time Macro Stop End Catch Error End Error For what it's worth, I don't get a syntax error when I save this. I can see that the End Error sequence here is useful, or if you had many lines of code between the Catch Error - End Catch Error sequence. Otherwise, the simple "Halt Macro" error handling available with each command should be enough most times. Something obvious just occurred to me. The reason for the two pairs On Error and Catch Error is that you could have multiple errors you would like to handle. A bit of a forehead slap to my chagrin. And I appreciate that it's at minimum 5 extra lines of code but it's simple, intuitive (if you think of it like any other logic condition set) and shouldn't add anything to the overall run time of the macro. Don't forget you can use your snippets to create a On Error group. Quote Link to comment Share on other sites More sharing options...
paul Posted October 9, 2009 Report Share Posted October 9, 2009 I would have thought the idea of putting error handling such as "Halt Macro" in the actual commands was to avoid having to use On-Error sequences just to stop a macro with about another 5 lines of code (seems inefficient to me - but I'm only a user ). So, I tend to agree ... bug rather than feature! Let's examine the logic here. I think we all agree that if the specified key is not pressed within the nominated time, then an error occurs - "The condition was not met within the specified amount of time". There must certainly be a standard method of handling all errors. When an error occurs, MEP provides us with 4 alternatives: - Ignore the error and continue - Ask the user what he wants to do - Handle the error with error-specific code (On Error/Catch Error) - Halt the macro The 1st choice allows the developer to say "I don't care about this error - just carry on as if the error hadn't occurred". The 2nd choice allows the user to choose whether to Halt the macro, ignore the error and continue, or handle the error (I don't really understand what this last choice really means, as it seems to behave like the ignore choice; perhaps the user is expected to conjure up some error-handling code and somehow get the running macro to execute it ). The 3rd choice allows the developer to plan what to do in advance of the error. This offers maximum flexibility, and could presumably offer the user a menu of choices if relevant. The 4th choice is a bit of a cop-out! It's the default choice for many (or perhaps all errors?), and just provides the same behaviour as in ME3 (which was almost the only choice in ME3). The important point to consider is that choices 1 and 3 represent decisions that the developer has made about what to do, so no notification message is required when the error occurs. Choice 2 obviously tells the user an error has occurred - he gets to decide whether to carry on or give up. Choice 3 represents the fully planned approach - the developer chooses whether to display error messages or not. Choice 4 really is no choice at all. When choice 4 is mandated, I definitely want to know that an error has occurred. Otherwise who knows what is going on? If I want the macro to stop without any notification, then I must write the error handler. I think that if we're asking for this particular error to halt the macro with no notification message, then we're asking for this behaviour to occur throughout MEP for all commands, whenever such an error occurs (which I am definitely not in favour of). IMHO, it would be unreasonable to request this pattern of behaviour for the Wait For Key Press command alone. In his original post, Rich expressed a wish that MEP would behave more like Visual Basic. Unfortunately, VB no longer behaves like this - VB.Net now provides error-handling very similar to MEP. So, IMHO, this is not a bug, but a feature! Quote Link to comment Share on other sites More sharing options...
Cory Posted October 9, 2009 Report Share Posted October 9, 2009 Paul, Cory: Can you try my code and tell me what happens please, as I still don't see why that is correct behaviour. In particular, why doesn't the macro stop immediately (with no message) when I hit Enter at once?I have already tried and reported on your code some time ago. It works just as I would expect it. Sorry, I don't see any bugs. Perhaps some shortcomings but everything works as designed for me. Quote Link to comment Share on other sites More sharing options...
Cory Posted October 9, 2009 Report Share Posted October 9, 2009 Do you mean that you think you can nest multiple Catch Error commands inside the End Error commands thus... I can see that the End Error sequence here is useful, or if you had many lines of code between the Catch Error - End Catch Error sequence. Otherwise, the simple "Halt Macro" error handling available with each command should be enough most times.Yes Rick. Because they needed to design for the greater functionality the simple cases will suffer a little. All of programming is like this in my experience. Some commands have several possible errors and in most cases that means different courses of action. I'm just making this up but consider writing to a file. If the file didn't exist I'd need to aborth the macro, report to the admin and tell the user wha'ts happening. If the file wasn't ready becasue someone else was writing to it at that time I might want to try again 5 times at intervals of 1 second before bombing out. I don't see any problem in all this. If I have a macro that is supposed to move a file for a user and it fails I want them to receive an error message. And the notion that anyone would write a program with potential unreported errors that would continue sounds perverse to me. Then again I think handling an error on the back side is a little backward as well. I mean if I'm moving a file I would rather check first to make sure it's A) there, and be ready, before trying to move it so that I can handle the situation before an attempt. But I have had a few instance where handling it on the back side worked better but these are rare instances but they prove the need. I concede that there are a few times however where one would want a failure to go without report and/or abort but these are rare enough that the extra overhead of 4 lines of code should be no big deal. But having an critical unanticipated failure in a the middle of a huge macro and not letting the user know abou tit and report to me? Naw, I'll pass. I have complained about some issues in reporting and the error logs but as far as this all works it all apears as right as rain. Quote Link to comment Share on other sites More sharing options...
terrypin Posted December 12, 2009 Report Share Posted December 12, 2009 OK, I follow you now. I think it implies two bugs in ME Pro. To make the discussion more accessible I've modified your example as follows: 1. I have no idea what window that Text Type <ALT>sct command is supposed to type into or what it's supposed to do. But it seems irrelevant to the current discussion so I've removed it and its associated Wait command. 2. I've ignored the On Error stuff, because I agree with you: that should be unnecessary if the Wait for Key Press: ENTER works properly // I'll use a window we can all access, Notepad. Activate or Launch: Window "Notepad", Program "NOTEPAD.EXE", Parameters "" Wait for Window Title: Notepad Wait for Key Press: ENTER // My version: set to HALT MACRO if time exceeds 5 seconds <COMMENT Value="I'll use a window we can all access, Notepad."/> <ACTIVATE OR LAUNCH Title="Notepad" Exact_Match="FALSE" Wildcards="FALSE" Path="C:\\WINDOWS\\NOTEPAD.EXE" Mode="\x00" Default_Path="TRUE" Wait="1" Wait_For_Program="12" _IGNORE="0x0006"/> <WAIT FOR WINDOW TITLE Title="Notepad" Partial="TRUE" Wildcards="FALSE" Indefinite="FALSE" Hours="0" Minutes="0" Seconds="2" _PROMPT="0x0014"/> <WAIT FOR KEY PRESS Key="ENTER" Indefinite="FALSE" Hours="0" Minutes="0" Seconds="5" _COMMENT="My version: set to HALT MACRO if time exceeds 5 seconds"/> Unless I'm making some basic slip (wouldn't be the first time!) then my macro should simply open Notepad and if I press the Enter key within 5 seconds it should do so (moving down a line in Notepad) and immediately stop. If I take longer, then after no action in Notepad it should stop, with no messages. But it fails in both scenarios, implying two separate bugs: If I immediately type Enter, Notepad correctly moves down a line but the macro continues, and then displays an error message "The following error was encountered: The condition was not met within the specified amount of time." If instead I do not type Enter at all, after 5 seconds or so the same error message appears. To explain the appearance of the message (one of the two bugs implied) I thought maybe there might be a setting somewhere that would enable/disable the message when a macro was halted. The only potentially relevant setting I could find was Options > Preferences > General > Dialogs > Inform the user when a macro has been cancelled which is not enabled. Hopefully we might get some advice from ISS, whom I've also emailed. -- Terry, East Grinstead, UK Email from ISS today: Issue [iSS7579] 'The 'HALT MACRO' option under the OnError tab seems to be getting ignored in some cases' submitted by you has been resolved. The change will be available with the next release of Macro Express Pro. -- Terry, East Grinstead, UK 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.