Jump to content
Macro Express Forums

joe

Members
  • Posts

    1,002
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by joe

  1. Hello IceBox! For future reference: because notepad.exe is installed in the system path, Macro Express will locate it without requiring a fullpath name in the Program/Path Name field.
  2. Hello Robert! A disabled macro can still be run from the right-hand pane in the Macro Explorer window by, for example, right-clicking on it. Maybe somebody ran it?
  3. HeyJim - I can guarantee that, in the following code segment, the loop will exit every time the pixel color at coordinate 100,100 changes to white. This happens 100% of the time. Period. It is an absolute. There are only two events that can occur which would prevent this loop from exiting: The window containing the pixel does not have focus The pixel, when it changes, does not change to white. In your case: Since you are processing through windows are you using the relative to window option instead of relative to screen? The macro may be waiting for the wrong color at the wrong coordinate in the wrong window 10% of the time depending on what is on your display at a particular instant and how the target program is running. You say that putting in extra loops works better. That makes me think that there is a timing issue between what the target program is presenting and what the macro thinks should be occurring.
  4. Welcome to the group Andy! I believe that, like Windows Explorer, using the right arrow or plus sign key will expand the current folder tree. The left arrow or minus sign key will collapse the current folder tree.
  5. Hello IceBox! Because this is a common question I thought that I would take the time to place an excerpt from the Macro Express Explained book here that covers this subject: -------------------- There are certain features about Macro Express that you may want to change, such as the ShortKeys punctuation characters, the "Macro Aborted" message, and so forth. You can change them, but not through the (Options | Preferences) dialog. Instead, Insight Software Solutions has a playable macro utility named TweakMe3.mxe that is available free from their web site. It allows you to change settings stored in a special key in the Registry. Note that it is an unsupported utility meant to be used at your own risk. Personally I have not had any problems using it. If the (Options | Preferences | Miscellaneous | All Users Use the Same Settings) checkbox is checked, and if the currently logged in user has read and write privileges to the HKEY_LOCAL_MACHINE area of the Registry, these advanced options are stored in: HKEY_LOCAL_MACHINE\Software\Insight Software Solutions\Macro Express\AdvOptions Otherwise they are stored in: HKEY_CURRENT_USER\Software\Insight Software Solutions\Macro Express\AdvOptions Here is a short description of each advanced option. Download the macro and read through it to learn more, and to also see some advanced macro programming techniques. Online Delay The If Online command enables you to test if you are connected to the Internet. As a default, it will wait 5 seconds for a response, then time-out. This option allows you to change the wait time. Activation Prefix Determines whether to display the words "Window:" or "ShortKey:" in the Activation column of the Macro Explorer window. It affects only the two activation types. The default (setting the value to "1") is to display the words with the ShortKey name or Window title. You can change this to "0" and display the ShortKey name or Window title by itself. Scope Prefix This is similar to the Activation Prefix. It determines whether to display the words "Program Specific:" or "Window Specific" in the Scope column of the Macro Explorer window. This affects only the two scopes. The default (setting the value to "1") is to display the words with the Program name or Window title. You can change this to "0" and display the Program name or Window title by itself. ShortKey Punctuation Chars Specifies which characters are used to activate a ShortKey macro when Use Suffix Keys and Use Punctuation Chars are checked in the (Options | Preferences | ShortKeys) dialog. This affects the keys listed in the Suffix column of the chart in the ShortKeys section of this chapter. By default Macro Express uses ! " ' ) , - . : ; ? ] and ` If you specify the list of punctuation characters to use then you must specify every character you want to use, not just additional characters. ShortKey Invalid Chars Specifies which characters are invalid as part of the ShortKey activation sequence when Use Prefix Keys is checked in the (Options | Preferences | ShortKeys) dialog. This affects the keys listed in the Prefix and Name columns of the chart in the ShortKeys section of this chapter. By default Macro Express uses ~ ( | { } [ and : If you specify the list of invalid characters, you must specify every invalid character, not just additional characters. Macro Stop Abort Message Hotkey Abort Message Right Click Abort Message These options specifies whether the "Macro Aborted" message is displayed when a Macro Stop command executes, or when the Abort Macro HotKey is pressed, or when you right-click on the Running Man icon in the System Tray. All three choices are handled separately, but the default setting for each is "1", which is to display the message. The Macro Stop command will not display the "Macro Aborted" message from any top-level macro no matter how this advanced option is set. It will only display the message from a lower-level macro, which is any macro run from another macro using the Macro Run command. Display Gradients Determines whether to display gradient colors the header bars in the Macro Explorer, Scripting Editor, and Direct Editor windows. The default setting is "1", which is to display the gradient. Macro Priority This integer value specifies how much time that Macro Express is allowed to use your computer's CPU/processor. The allowable range is 0 through 2,147,483,647. The default value is 1,000. Zero turns this feature off, which gives full priority to Macro Express. You will need to enter a "-1" in the dialog to turn it off, which is then converted and stored as a zero. A "1" gives the lowest priority to Macro Express. The higher the number the more priority is given to running your macros and conversely for the lower the number. Experiment with caution! Show Pixel Color in Hex in Mouse Locator This displays both the decimal and hexadecimal value of a pixel color on the screen within the Mouse Locator tool. Add a REG_DWORD named MSLocate Hex Color to whichever key the advanced options are stored. Give it a value of "1" to turn this feature on and a value of "0" to turn it off. Banker's Rounding There is another advanced feature that is not displayed in the TweakMe3 dialog which affects decimal rounding. Macro Express defaults to a method called asymmetric arithmetic rounding; however, it can be changed to banker's rounding. Add a REG_DWORD named Bankers Rounding to whichever key the advanced options are stored. Give it a value of "1" to turn this feature on and a value of "0" to turn it off (asymmetric arithmetic rounding on). For more on these two types of rounding, please refer to the Round section within the Variables chapter.
  6. If you are waiting for a pixel to change into a particular color, and if it is inside a window, use the relative to window option instead of relative to screen. This way it does not matter if the window moves or not. Make sure that the window containing the pixel has focus. A pixel coordinate is a pixel coordinate is a pixel coordinate. It is an exact location, so if you are sure that that is the correct coordinate, then everything should be fine. Once that pixel changes to the expected color, the loop will exit. Are you sure of the color that you are waiting for? Is it always the same color? If not, you will loop forever. Put a 10ms delay in the loop. Give the macro time to breathe. Without seeing the actual code, these are the only suggestions I can make.
  7. No, sorry. No shortcuts. It's more than learning just Macro Express. If you want to effectively do data mining on the internet, you will also need to learn about Windows Scripting, the DOM (Document Object Model), a scripting language, and maybe some DHTML for good measure. If you wanted to control Excel using Macro Express you would want to learn something about Excel and its application interface, wouldn't you?. Same with Microsoft Word and any other application automation task. The point is: knowing just Macro Express to automate an application is never enough. You must also know the application and the language that controls it. In your case, your target application is your browser and the DOM (a web page). As developers, we face this situation every time a client asks us to generate macros to do this or that in application X or Y. We certainly know Macro Express, but in many cases have never heard of application X or application Y. So, we must learn something about them in order to generate macros for them. As to data mining on the internet, tools are available that are designed for mining web pages, and more than likely, you already have them. Microsoft's Windows Scripting Host is built in to Windows XP, 2000, and 98. To use it effectively, you will need to learn about DOMs, which you can do from many, many different web sites including Microsoft's. And you will need to learn a scripting language. VBScript, JScript, Javascript are all languages that the Windows Scripting Host uses, understands, and is driven by. Which means that you already have them too because they are part of the Windows Scripting Host. Others in this forum, such as Randallc and Floyd, have used Windows Scripting Host files and have provided examples on how to populate and control them through Macro Express. Internet data mining is a subject near and dear to our hearts at Professional Grade Macros because lately we have been working on generic internet data mining tool macros. We started with macros that return to Macro Express (in the form of CSV files) arrays of different objects on any given web page. Objects include table data, links, and so forth. Also, a very sweet macro that generates other macros to automatically log in to your password-protected web sites without using the Text Type command. It uses some data mining techniques instead. Very cool, indeed!
  8. Welcome to the group Rob! I've done a quick check within the Preferences dialog and do not see anything related to printing a macro list. About the only thing you can change is the printer font (File | Printer Font).
  9. Hello HeyJim! It is true that Macro Express has no specific built-in commands to perform the tasks in your example. It is also true that there are no built-in commands to find and change specific words in a Word document or specific values in an Excel spreadsheet. These things can be done of course, but it requires that you and I build macros to do them. So to answer your last question, I would rank ME's internet capabilities the same as those for Microsoft Word, Excel, or any other software app which needs automation. Everything that you want to do in your examples can be done by having Macro Express generate and control Windows Scripting files. The same can be said, for any other Office application.
  10. You'll be a macro-junkie in no time! The Get Pixel command is located inside the System category. You can turn off the categories using the "Options | Preferences | Appearance" dialog. Macro commands will then simply be listed alphabetically. Another way to quickly locate a command is to start typing it from within the Search for Command field located below the Commands window.
  11. Hello Magic! There is preference setting for this under "Options | Preferences | Scheduler": Disable Screen Saver when using Scheduled Macros. The help file says this about it: You can turn the feature off by unchecking the box, but I am not sure if the screen saver in your case would interfere with the macro. I guess that it would depend on what the macro is doing. I would suggest a test, because I am also not sure by the explanation whether a scheduled macro would fire at all when the screen saver is engaged.
  12. Hello HeyJim! This example assumes that you already know the pixel is white at screen cooridinates 100,100. It will loop forever with a 10ms delay until the pixel is no longer white. The reason for the delay is to allow your CPU to take up other tasks. Although technically the delay is not required because Macro Express handles CPU cycles internally.
  13. Hello Carlos! Yes, when a called macro ends, control goes back to the calling macro even if you do not use the Macro Return command. So in your example, a b c d A B C D e f g would be the correct answer. Exceptions are if the called macro aborts for any reason, or it encounters a Macro Stop command.
  14. Welcome to the group Carlos! All variables in Macro Express are global in scope. It does not matter in which level within a chain of callable macros the variable is set or reset. All other macros, up-and-down the calling chain will use the same variable and variable value. In other words, you may have an unlimited number of macros calling other macros, but they will all use the same T1-T99, N1-N99, and D1-D99 set of finite variable tags. This will be true for as long as the current macro session is running. Once a new macro session is fired, all variables are immediately set back to their default empty or zero values. A macro session starts when a macro, or chain of macros, begins execution and ends when it, or they, stop. You should look into the native Variable Save and Variable Restore commands. These will allow you to save an instance of a variable before changing it and then restore it back again. If you need to save and restore more than a single instance of a variable, then there are routines available in our PGM Functions Library that will allow you to save and restore up to sixteen levels of variables.
  15. Welcome to the group matty and ol3ears! Are you looking to move the mouse because you want to click on a link that consists of the text you searched for? Unfortunatly, I think that Internet Explorer, like Microsoft Word, cannot make use of the Mouse Move to Text Cursor Position command. If you want to engage a link, have the macro close the Find dialog, set focus to it, and hit the Enter key. Use Text Type command and enter <ESC><TAB><ENTER> to do the three steps.
  16. Hello cuppanews! I know you are referring to the Mouse Move command, however, if you are wanting to calculate coordinates for the purpose of knowing where to click on a control, you made not need to take the steps you mentioned. There is a convenient feature built in to the Mouse Click on Control command (Advanced tab) that allows you to offset the click either to the center of the control or at some other set of coordinates relative to it. You could also force the macro to do its own calculations using the Set Integer to Control Left, Top, Width, and Height commands. Or you could create a utility macro of your own to take the steps that you are looking for. Either way it sounds like a nice suggestion and you can easily submit it to Insight using "Options | Configure Bug Reporter | Request a Feature" within the Macro Express Explorer window.
  17. Welcome to the forum Bob! Here is a link to a previous discussion that should answer your question.
  18. You've got it right daviejr. Avoiding the Registry is a very good reason to use INI files. The only downside is working with integers or decimals. They are stored as strings in the file, which means an extra step to convert them when they are read back. However, it is not much of a downside at all!
  19. Thanks Mike! These will be added to my writing "utility" macros.
  20. Wecome to the group meuser33! Although the Alt+Space combination is not among them, there are actually 14 reserved combinations in the Macro Express HotKey list and are colored red. If you choose one of them, it may or may not work because it is reserved by Windows. I can think of other combinations besides Alt+Space that I personally do not use, but that others have used successfully. As to your question: no, you cannot make your own HotKeys, however, you can create your own ShortKeys that will activate macros.
  21. joe

    License

    Hello Iceman! I doubt that access to Macro Express license information is that straightforward. However, I don't think you need the editor to enter license keys. With a read-only installation like this, doesn't the License Macro Express option still appear when you right-click on the icon in the System Tray? If so, then maybe part of your automated installer batch could include running a playable (.mxe) that chooses the license option and enters the Name and Code fields.
  22. Interesting! I just checked at www.amazon.co.uk from where, I assume, you ordered the book. It says something totally different than www.amazon.com. Although we have no control over Amazon, Barnes and Noble, Indigo, or any other distributor, we can set you up with a free PDF file of the book while you are waiting for the physical one to arrive. Just email me at joe@pgmacros.com and I'll give you the details on how to get it. Thanks for joining the group and for your purchase!
  23. This should work. Repeat Until %N1% <> %N1% Web Site: http://www.pgmacros.com [Default Browser] Wait for Web Page: "" Repeat Start (Repeat 60 times) Variable Set String %T1% from Window Title If Variable %T1% contains "Macro Libraries" Repeat Exit End If Delay 250 Milliseconds Repeat End If Variable %N1% = 60 AND If Message: "Web Page Error" Else Repeat Exit End If Repeat End <REP3:08:000002:000002:0001:1:01:N1><HTTP2:1:F:http://www.pgmacros.com><WAITWEB2:000000:000000:><REP3:01:000001:000001:00060:1:01:><TVAR2:01:06:><IFVAR2:1:01:7:TMacro Libraries><EXITREP><ENDIF><IMSD:250><ENDREP><IFVAR2:2:01:1:60><AND><IFMESS3:00000:1:1:Web Page Error Could not load the web page. would you like to try again?Center:Center><ELSE><EXITREP><ENDIF><ENDREP> It is designed to avoid waiting for a particular page to load. Instead the Wait for Web Page command waits indefinitely for any page to load. If the browser launches at all then some web page should load, even if it is one of those "This page cannot be found" error pages. The Repeat Start (Repeat 60 times) loop is used to test for a particular window title to have focus, which is the title of your target web page. Since it delays 1/4 of a second between loops, it will wait 15 seconds and then exit. If the loop counter is 60 then you are prompted to try again. This is only meant as an example. There are plenty of variations that can be made to this macro to suit your individual needs.
  24. Have you reported these ShortKey activation problems? Use the "Options | Configure Bug Reporter | Report a Bug" feature.
×
×
  • Create New...