Jump to content
Macro Express Forums

kevin

Admin
  • Posts

    1,950
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by kevin

  1. I should also note that you need to remember the password(s) you assign. There is no way for a user to remove a password from a macro.
  2. Macro Express consists of two main components: the Player and the Editor. The Editor is used to create and edit macros. The Player will play macros in the macro file. The Player will run macros without the Editor running. You can even choose to install only the Player (without the Editor). This works well as long as you supply a macro file that has been created on another computer. In addition you can assign a password that prevents someone from accessing the Editor. Click Options | Preferences | Passwords to assign a password. You should note that unlike most of the preferences the password options are stored in the macro file itself. This means you can have one macro file that is password protected and you can have other macro files that do not require a password. In addition to assigning a password that must be entered before you can edit any of the macros in the macro file, you can also assign a password that must be entered before you run any macros in the file. You may also assign edit or run passwords to individual macros within a macro file. Open the macro in the Scripting Editor and click the Security tab to do this.
  3. When you do a Mouse Click on a Control, the mouse does not actually move. When you manually click the mouse, a Windows message is generated and sent to the control (or program) under the mouse. The Mouse Click on Control sends the message without moving the mouse. This allows for some very interesting macros. You can click buttons that are not visible and ... the mouse doesn't move.
  4. Randall: Yes, I would prefer 'named' variables too. I normally create a 'key' using remarks at the top of the macro to let me know what the variables are used for. The file is opened once by the Text File Begin Process and closed by the Text File End Process. In this case we're talking about copying files. By my estimation the entire overhead of the Text File Begin/End Process loop would be less than the overhead of a single file copy. When comparing Text File Begin/End Process with registry access, keep in mind that the registry is just one big file. It is true that Windows 'caches' reads from and writes to the registry but there is still file overhead. And, in this case, because of the file sizes, the file overhead of accessing the registry is much greater than the file overhead of Begin/End Process loop.
  5. Here is an example. No registry needed. This is very flexible. Change the values at the beginning of the macro. You may want to have your macro calculate the maximum number of random numbers to generate. The numbers are displayed at the end of the macro AND they are written into the file specified by %T5%. You can use the Text File Begin/End Process command to read from the file and do your copying. Variable Set String %T1% "" // Set maximim random number Variable Set Integer %N3% to 999 // Set number of digits per number Variable Set Integer %N4% to 3 // Maximum number of random numbers to generate Variable Set Integer %N5% to 100 // Work filename Variable Set String %T5% "%TEMP%\work.txt" // If work file already exists, delete it If File Exists "%T5%" Delete File or Files: "%T5%" End If // ---------------------------- // Repeat until the correct number of unique random numbers is calculated // ---------------------------- Repeat Until %N1% >= %N5% Variable Set Integer %N2% with a Random Number Variable Set String %T2% "%N2%" Variable Modify String: Pad Left %T2% Replace " " with "0" in %T2% If Variable %T1% does not contain variable %T2% Variable Modify String: Append "%T2% " to %T1% Variable Modify Integer: %N1% = %N1% + 1 Variable Modify String: Append %T2% to Text File End If Repeat End Text Box Display: T1 <TVAR2:01:01:><REM2:><REM2:Set maximim random number><IVAR2:03:01:999><REM2:Set number of digits per number><IVAR2:04:01:3><REM2:Maximum number of random numbers to generate><IVAR2:05:01:100><REM2:Work filename><TVAR2:05:01:%TEMP%\work.txt><REM2:If work file already exists, delete it><IFOTH:01:2:%T5%><DOFILE:08:NN:%T5%>><ENDIF><REM2:><REM2:----------------------------><REM2: Repeat until the correct number of unique random numbers is calculated><REM2:----------------------------><REP3:08:000005:000002:0001:1:01:N5><IVAR2:02:06:%N3%><TVAR2:02:01:%N2%><TMVAR2:14:02:00:%N4%:000:><TMVAR2:21:02:01:000:000: 0><REM2:><IFVAR2:4:01:8:T2T><TMVAR2:07:01:00:000:000:%T2% ><NMVAR:01:01:1:0000001:2:0000001><TMVAR2:20:02:00:000:000:%T5%T><ENDIF><ENDREP><TBOX4:T:1:CenterCenter000739000365:000:T1%T1%>
  6. You could put the numbers into a string variable and then do an If Variable Contains. Just make sure you add some separation before putting the number in the string variable.
  7. This might provide a clue. Windows XP changes the color of a button when the mouse pointer is moved over it. This makes it so you cannot use the Mouse Locator to determine the pixel color. This may also explain why it works 90% of the time and fails sometimes. Could it be that when it works your mouse is not over the button (or visa versa)? To get around this, use the Mouse Locator to determine the pixel that you want and write a macro to get and display the pixel color in a Text Box. Run the macro with the mouse pointer over the button and again when the mouse pointer is not on top of the button. Do this when the button says 'Cancel' and again when it says 'Close'. This will result in as many as 4 different pixel colors (2 for Cancel and 2 for Close). Then write your macro using two If Variable statements separated by an OR: If Variable %N1% = 000000 OR If Variable %N1% = 210005 // The button says Cancel End If If Variable %N1% = 16777215 OR If Variable %N1% = 16776958 // The button says Close End If But, have you tried to use the Window Controls commands to determine whether the button says Cancel or Close? If the button IS a Window Control you can use something like this: Get Control %C1% (ISS Issue Tracker: Button) Variable Get Control Text: %C1% to %T1% If Variable %T1% = "Cancel" // The button says Cancel End If If Variable %T1% = "Close" // The button says Close End If
  8. Use the 'Get Pixel' and 'Macro Stop' or 'Macro Return' macro commands. Get Pixel: Screen Coords: 123,456 into %N1% If Variable %N1% = 000000 Macro Stop End If You will need to adjust the screen coordinates in the 'Get Pixel' command and the color value in the 'If Variable' command to suit your specific needs. Here are some other discussions about using the Get Pixel command: http://pgmacros.com/community/index.php?showtopic=337 http://pgmacros.com/community/index.php?showtopic=326 http://pgmacros.com/community/index.php?showtopic=233 http://pgmacros.com/community/index.php?showtopic=220
  9. I don't know if you are using Windows XP with Windows XP Themes but if you are ... I had trouble with some macros I was writing for Windows XP. The macro was using the Get Pixel Color command to determine the status of several checkboxes. I determined what color I wanted the macro to watch for (green) but it would not work in every checkbox. It turns out that the Windows XP themes use gradient colors and shading in many of the areas on the screen. The color looked to me like it was green but there were many different shades of green. And, some of the boxes that I thought were white actually contain different shades of white. I discovered what was happening by capturing the image from the screen and examining it in a paint/photo program. To fix my macros I had to adjust all of the pixel locations by hand. I could not rely on the Mouse Locator to position to the exact location.
  10. Macro Express uses the 'Windows Hooks' to watch for macro activations. Some Malware programs use the Windows Hooks to log keystrokes and perform other bad stuff. It is possible that Zone Alarm is detecting this activity and warning you about it. AntiVirus Firewall Spyware and Adware vendors have begun adding features to check for more and different malware. For example, Norton Internet Security is now checking for adware where previous versions did not. Writejb: Are you using Zone Alarm (just the firewall) or the Zone Alarm Security Suite (Firewall/antivirus/anti adware)?
  11. Hello all, After a bit of research (thus the delay in my reply) we have a some information about why the sort macro doesn't work when the number of items to sort gets moderatly large. Each macro command has a limit of 64K (65,536 bytes). The routine, as written, was trying to create a 'Variable Set String' command that exceeded this limit. Then Macro Express tried to interpret the extra information beyond the 64K boundary as additional macro commands. Since the additional information is not in the proper format, Macro Express displayed a message that an unknown command format was found and the macro was stopped. The solution is to write the sorted string to a file and then read the file into a variable using the Variable Set String from File command.
  12. This from the Knowledgebase explains why it works that way: Many scheduled macros do not work properly when the screen saver or power management features have been activated. To prevent problems, by default, Macro Express disables your screen saver or power management features if you have a Scheduled macro in your macro file. In most cases you should be able to get a Scheduled macro to work properly with the screen saver or power management features enabled by modifiying the macro. For example, you may need to send a keystroke and then delay to allow your desktop to be restored. To enable your screen saver or power management features when using a Scheduled macro, load the Macro Express Editor and click on Options | Preferences | Scheduler. Uncheck the box next to "Disable Screen Saver when using Scheduled Macros".
  13. The "Clear Variables" command allows you to clear variables.
  14. Moving the mouse is not enough, you must click in the new location. Mouse Move Screen 75, 284 Mouse Left Button Click Text Type: Greetings Wait Time Elapse: 0 Minutes 2 Seconds Mouse Move Screen 75, 555 Mouse Left Button Click Text Type: Hello Think about how you do this manually. You move the mouse to a location and the mouse arrow follows along. But until you click in the new location, the cursor stays where it was. The cursor indicates where text will appear when you type.
  15. I use the 'Macro Categories' to organize my macros by function. When I find that I am repeating some macro steps in more than one macro, I create a separate macro and 'call' it using the Macro Run command. For example, we have a set of macros that we refer to as our Test Suite. These macros are used to test Macro Express. The test suite opens Notepad, writes results to it, prompts the user to review the results, and then closes Notepad. I have a macro to open and close Notepad. I use the nicknames of macros to help keep things organized. For example, I use the prefix 'Function: ' in the name of any macro that is meant to be called by other macros. I currently have 60+ 'function' macros not including the function macros provided by the PGM Functions Library. Another technique that I use is to group specific macros in separate macro files (some members of this forum call these macro libraries). I have a separate macro file that I use when updating the Zip Code and Area Code data in our Zip Express product. You can either manually load different files by clicking File | Open Macro File or you can use the 'Load New Macro File' macro command to create a macro to do it for you. Within each macro I create a 'header' that includes what the macro does, which variables are used and any external files needed. You can see examples of this technique by downloading some of the macros in the shared macros web page or by downloading TweakMe3 or Pop-N-Pass from our More Macro Express Downloads page.
  16. Variables defined in one macro are automatically available to any macro called by a Macro Run command from within that macro. If that is not possible then you need to save and restore the variables some way. There are several techniques: // Save / restore all text variables (%Tx%) Variable Save Text Variables Variable Restore Text Variables // Save / restore all variables Variable Save All Variables Variable Restore All Variables // Save / restore a single variable using an .INI file Variable Modify String: Save %T1% to INI File Variable Set String %T1% from INI File // Save / restore a single variable using the environment variables Variable Modify String: Save %T1% to Environment Variable Variable Set String %T1% from Environment Variable // Save / restore a single variable using a text file Variable Modify String: Save %T1% to Text File Variable Set String %T1% from File: "T1" The 'Variable Save' command saves the variables in memory.
  17. Macro Express does not have a macro activation that occurs when it detects Windows is shutting down or rebooting. But, if you have Macro Express load when Windows loads, perhaps you could do something with a macro that runs on Startup. Create a macro that sends an email message. Set its activation to 'On Startup'. Disable it during the times when you would not want to be notified. Enable it other times. The email message would not be sent when the reboot starts but it would be sent when Windows comes back up after a reboot.
  18. Renee, If you write your macros on a machine running a newer version of Macro Express than your workstations, then any macro commands that are unique to the newer version will cause problems on the older version. For example, say you write your macros using v 3.5c but the target machine is running v 3.4. You would have a problem if you used any features that were introduced after v 3.4 was released. You should be able to avoid problems between v 3.5b and v 3.5c as long as you do not try to play system sounds in the Sound Wave command or use the Keyboard Decimal as a hotkey. These are the only two things listed on the list of changes for v 3.5c that would cause problems.
  19. When you close a running program by clicking on a menu entry, button or the X in the upper right-hand corner of the window, certain events are fired off to tell the program that you want it to close. The program may prompt you to save, it may close files or do other clean-up tasks. The Terminate Process macro command does not work the same way. It is more abrupt and should probably be used as a last resort. There are other macro commands that 'request' that a program close. The 'Window Close' command sends a 'Windows Close' message to the specified window. This will normally close the specified window. If the window is the top level window then the entire program should close. The 'Program Shut Down' command sends a 'Windows Quit' message to the program. This should tell the program to gracefully shut down, including all windows associated with the program. The program is given a chance to save and close files and do whatever cleanup is needed. The 'Terminate Process' command tries several things in an attempt to terminate a program. These things can terminate the program without giving an opportunity for a 'graceful shutdown'. The steps are: 1. Issue a 'Windows Close' message (like the 'Window Close' macro command'). 2. * Wait to see if it succeeds. 3. Issue a 'Windows Quit' message (like the Program Shut Down' macro command). 4. * Wait to see if it succeeds. 5. Issue a Quit message to the thread. 6. * Wait to see if it succeeds. 7. Issue another 'Windows Close' message. 8. * Wait to see if it succeeds. 9. And finally, if all else fails, it sends a 'Windows Terminate Process' message. For this to succeed, you must have elevated privileges. In other words, this may not work for non-administrative users. * Note: The amount of time that the command waits is determined by the 'Timeout' value entered in the 'Terminate Process' command dialog. That is the maximum time that the program waits. If the attempt succeeded in closing the program, then the macro immediately continues. If more than one instance of a program is running, the 'Terminate Process' command will attempt to terminate whichever one Windows finds first. Because the terminate process command does not allow for a graceful shutdown, you may experience certain side affects. In the specific case you describe, you may need to create a repeat loop that includes a Terminate Process command and a Delay command to shut down all instances of the program (as suggested by Chris).
  20. Randall, I'm glad it is working out. I looked at your macro and it looks fine. Yes, it is important to use a text editor, not a word processor. Notepad works fine. It surprises me that this is necessary. What does the original macro command look like?
  21. Randall: Oops! I was mistaken: \n is the Line Feed not CRLF. And I wrote that part of the code and the help topic that goes with it. You would think I would remember correctly. My memory must be going. Sorry. Please let us know what the problem was when you get this to work. Did it have something to do with the separator (\s) characters? Joe: Thanks for posting the example without pointing out my mistake.
  22. Randall, A couple of quick guesses and a hint: You do not need or want a CRLF between macro commands. The \n is equivalant to CRLF. By using \r\n you are in effect doing CRCRLF. The hint is to write your macro in the script editor the way you want it to appear. Export to a playable (.mxe) macro. Edit the playable macro and it contains what you need. You will, however, need to insert \n (CRLF) and \s (Separator char)characters where appropriate.
  23. Rob, Many programs create different values for a Windows Control each time the program runs. This is not limited to web pages within a browser. There are several techniques you can use to accomplish what you want to do. See my reply to another similar question here: How to Capture Status Bar Info?, What am I doing wrong
  24. Robert, You are correct, there is no need to disable one macro while another one runs. What I was suggesting in my reply was explained quite well by Randall. I suggest that you create a 'secondary' macro and run it from a variety of places in your 'main' macro using the Macro Run command. For this example I will assume the secondary macro is named "Terminal Macro". The "If Window Running" command determines if a window is running whether or not it has focus. If "Window on Top" command determines if a window is running and has focus. I expect that the macro fragment would look something like this: If Window Title "LanDesk Connect" is running AND If Not Window Title "LanDesk Connect" on top Macro Run: Terminal Macro End If Place these commands in several places in your main macro. Randall, You said: This is a great suggestion. I love VMWare. We use it to test our products on a different versions of Windows. However, VMWare is not inexpensive. Each VMWare session is like a separate computer. Macro Express can be running on your computer and also be running within each VMWare session that you are running. This is a way to have multiple copies of any program, not just Macro Express, running at the same time. However, each VMWare session has it's own hard drive and so, to share files back and forth, you need to use Windows Networking (shares, etc.). I find the VMWare sessions (understandably) run much slower that the main version of Windows. Still, the speed is more than acceptable. For example, I have a 3.2 GHz CPU. My Windows 98 VMWare session runs as fast or faster than the 550 MHz system I had when I was actually using Windows 98 as the primary OS.
  25. Hi Robert, Macro Express 3 will only run one macro at a time. So, if another macro is already running, a second one will not run. However, you may be able to add something to your macro to make it work. Perhaps you could use the 'If Window Title is running' and 'If Not Window Title on top' commands or the 'If Program Name "" is running' and 'If Not Program Name on top' commands.
×
×
  • Create New...