rick
-
Posts
12 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by rick
-
-
Shortkeys only work on MEP restart .......
I disabled AutoRestore, and setup my Reset Hooks Macro to run every 5 min. However, my shortkeys still failed.
Like you, only restarting MEP seems to fix the problem.
No problem with slow text entry tho'.
Edit: This morning none of my shortkey-activated macros would run. Annoying but usually quickly fixed by using Tools > Restore Keyboard & Mouse hooks. But this time that fix failed. Eventually I closed and re-started ME Pro and the shortkeys work again (for now!).FWIW, in case it's related, I was also experiencing very slow text entry. For example, text typed by hotkey-activated macros. This behaviour too was resolved after restarting ME Pro. This may also be appropriate input to the thread 'MEP slowing machine down dramatically.'
-
Learning VB Script .......
I know what u mean ...Since I don't know VB Script, I hit the learning curve at a dead run and broke my nose.I still intend to learn, but between work and school and wife and daughter, I am just sitting at the bottom of the curve staring dreamily uphill.
However, I'm sure ur no dummy when it comes to these things, and it's just a matter of getting a toe into the door, proceeding a bit at a time. I don't know VBScript but the bits of it I've seen look an lot like Visual Basic about which I know a tiny bit.
May I suggest:
- Recording macros with Visual Basic for Applications in the Microsoft Office applications - it's a good way to see how what you do translates into code. I'll bet u did it with ME.
- Last time I looked (admittedly a long time ago), there a lot of web sites with tutorials and help on VB (haven't looked for VBScript).
- I bought a book to learn some basics. Now, u can download pdf's (to try b4 u buy, of course - search google for pdf files: eg Visual Basic 10 for Dummies filetype:pdf.
- Finally, if u can learn to how to use Visual Basics "Object Browser" to work out the relationships between objects, methods, properties etc and to find the appropriate Help on a command, I think that will save a bit of time eg so that u don't use a method or a property that doesn't belong to an object.
I should also mention that the Microsoft Community forums offer help for programming problems.
- Recording macros with Visual Basic for Applications in the Microsoft Office applications - it's a good way to see how what you do translates into code. I'll bet u did it with ME.
-
'Scuz my ignorance but wot's HTA? Also, my suggestion for using VB: ....
I looked up answers.com: "HTML Application" was the only thing that seemed "sensible", but I'm none-the-wiser.
HTAs, VB, but probably not VBScript.....................I'm learning VB and derivatives like VB Script, and VBA right now and am planning on doing what you are suggesting so this his highly theoretical advice.
...
One can create a simple VB application to launch from MEP and depending on the type of results one can use windows controls and the relevant 'wait for' commands in MEP. IE when the user clicks "OK" have it display the results in a label and MEP can read that value back in with Get Control Text. VB.NET is pretty simple to learn and once you develop your basic menu form then in the future it would be super simple to make variants. I've messed with a few but have been holding off because it seems that if a learn a little more VB I can replace some of these macros with a complete VB apps.
I'm no expert at VB. However (also, in theory), I would have thought the way to do it would be create a dialog in VB with a "UserForm", that you would eventually run (using MEP) as an ".exe".
Add radio buttons to the form for your multiple choices.
Presumably, you would save the state of your radio buttons (True/False) to a file when you close the dialog, and process the text file using MEP commands.
-
Does anybody else have concerns about hooks being dropped?
I've had to turn on the "Auto Restore" option because the Keyboard Hooks seemed to be dropping. Despite this, I still seem to have a problem with shortkeys.
I did write a scheduled macro to run every 10 min to Restore Hooks but disabled it when I found the "Auto" option - may need to renable it if the shortkey problem continues.
Reset Hooks
-
May I also suggest that the first line of posts say something relevant to the content of the post.
The reason for this is that, if one wishes to use Outline Display Mode (for example, try it on this thread ), often the replies are listed as "quote, poster's name, and date" with no idea as to content.
Admittedly, if you go to any other forum, netgroup etc all you'll see in an outline may be "re: whatever the subject is about". However, doing as I humbly suggest makes it a little easier to digest the posts.
What do you all think?
First and foremost please try to include examples that demonstrate your problem. It might be easier for you to go into a detailed explanation but consider this. If you skip it and there is X amount of work then the users end up spending several times X to consider your problem. Also since we are often catching up to what you have spooled up in your head you can probably double that. Secondly you will get a lot more people to consider your problem and get quicker more relevant response if you do so.Secondly ......
..... Oh, and get my posts answered quicker and more efficiently!
-
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.
-
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
- Handle the error with an On-Error - End Error sequence.
-
What is supposed to happen is this:Can you explain exactly what you want to happen?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!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.
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.
-
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!
The first option sounds like the solution, I'll try 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.
I thought of the second but it's too global, and still doesn't stop the Script Error dialog.
Yes... I don't think the Help explains it very well here, compared to rest which I usually find very good.I don't know if you can combine the On Error and Catch Error sets. The help file shows a simplified example.
Believe me ... tested the c*!p out this. Usually find works better in the morning than 12 MN tho'.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.
Will do. Thanks for your helpful commentsLet us know what you find out, I'd love to know but i don't have time to test them myself right now.
- 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.
-
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
-
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
Keyboard Hooks
in Macro Express and Macro Express Pro
Posted
Update on 5 minutely Reset Hooks Macro ....
This seems to be working lately.I haven't had to restart MEP.
Perhaps, it's not compatible with the Auto Restore option being on at the same time?