Jump to content
Macro Express Forums

kevin

Admin
  • Posts

    1,950
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by kevin

  1. The way to do this is to write a macro that uses MS Word to open a document, perform the search and replace, save, close and repeat with the next document.
  2. Macro Express will automate things that you would normally type or do with your mouse. You may be able to navigate a TreeView or ListView using keystrokes and/or mouse movements. Another thing to try is the Windows Controls. If the TreeView or ListView is defined as a component, then you may be able to send mouse clicks or text type to it. Beyond that, I would need to know more specifics about the application you are using. It is true that Macro Express contains some commands to launch Windows Explorer to a specific folder. But this does not mean that Macro Express can interact with SysListView32 and SysTreeView32 in ways other than those listed above.
  3. The only way to do this is using the Windows Control commands. This will work if the program you are dealing with has defined the input field as a Windows Control. There is a sample macro that demonstrates sending information to a program in the background using Windows Controls. Open the samples.mex file that is installed in the folder where the Macro Express program is installed and look at the macro titled Calc ulator and Note pad. Try the Wait for Mouse Cursor: Arrow or its complement Wait for Not Mouse Cursor: Hour Glass.
  4. No. If I remember correctly, there are technical reasons that prevent referencing a control relative to a window. However, I can think of two possible work arounds: 1. If there is a Window Control that represents the entire window, you may be able to use the Get Control command for it and use that control to calculate the position of the control within the window. This will only work if, unlike the other Window Control you are working with, the Window Control of the main window remains consistent. 2. Or you could try something like this: - Save the size and position of the window you are working with. - Set the window to a specific size and position. - Capture the Control. - Restore the original size and position of the window. Yes, this would cause the window to move as the control was captured. But, if you use the Variable Save and Restore technique, you may only have to do this once.
  5. The only option to save and restore the content of a control variable is to use the 'Variable Save Control Variables' and 'Variable Restore Control Variables' commands. However, these commands save and restore all control variables and any variables saved with the 'Variable Save' command are lost when your computer or Macro Express are restarted.
  6. We have noticed that some programs create a new version of the control each time they run. It is not inconceivable that other programs create new versions of the control on different days. When you add a 'Get Control' command to your macro and use the Get Control Utilitiy, there are two flavors of controls that are returned. If you have tried to Get the Control with the 'Get Control Using Text' option unchecked, then check it and see if that helps (and visa versa). Some of the macros I have written require the 'Get Control Using Text' option to be checked while others require it to be unchecked. If that doesn't work then you may need to use the 'Capture Control' command to obtain the Window Control information when the macro runs instead of when you are writing it. This, however, requires that you know the position of the control.
  7. There is an example in the samples.mex file that you might want to look at. The samples.mex macro file is installed in the folder where the Macro Express program is installed. By default, c:\Program Files\Macro Express3. This sample only works on a system with Windows XP and (if I remember correctly) with the Windows XP theme) but you can study it to learn about the technique. The macro is named "Calc ulator and Note pad". To try the sample macros, click File | Open Macro File and open the file c:\Program Files\Macro Express3\samples.mex.
  8. Have you tried saving the mouse cursor position before clicking on the link and restoring it at the end of the macro? Perhaps something like this will work: Variable Set Integer %N1% from Mouse X Position Variable Set Integer %N2% from Mouse Y Position // Do macro stuff Mouse Move Window %N1%, %N2%
  9. Arthur, I do not have any experience with VirtuaWin nor have I heard from anyone who uses it. Whether or not Macro Express will work with VirtuaWin depends on how VirtuaWin is written and on how it interacts with Windows. Windows imposes some limitations when using Remote Desktop, Windows Terminal Services, or Citrix. For these programs when the 'session' loses focus, Windows does not allow Macro Express macros to run. However, when using a program like VMWare, macros continue to run even if the session does not have focus. When using Remote Desktop I found that Windows XP only allows one session to be logged on at a time. But Windows 2000 allows more than one session at a time. So the version of Windows that you are using may affect how it works. Since I have not used VirtuaWin I cannot tell you whether or not Macro Express will work with it. Macro Express comes with a free 30-day trial so you can try it. I would like to hear whether or not you are able to get it to work. I suggest that you start with a simple macro to make sure that the macros will continue to run in your environment when the session does not have focus.
  10. Capturing a macro will create a macro that will record the keystrokes, mouse movements and mouse clicks you performed as you recorded the macro. This works great for many macros. However, for some tasks you need to adjust the macro after it has been recorded. Use the Scripting Editor to make these adjustments. I recommend that you start by reading the Quick Start Guide and the tutorials. Click Help and then Quick Start Guide. Then Click Help, Macro Express Help, and read the tutorial section. There are several topics in the help that discuss Windows Controls. You can search the help for 'Control' and read the resulting topics. Another, perhaps easier approach, would be to use the 'help topic organizer' at the top of the help. Look for this section of the help:Use the drop-down to choose Controls and then click and read each section. That is why we are suggesting that you use the Windows Control commands. Each window, dialog, and component (buttons, edit boxes, etc.) on your screen are assigned a number or 'handle' by Windows'. The Windows Control commands find the handle to identify the Windows Control. The Windows Controls work in many, but not all, tricky situations like you are describing. From your description, it sounds like this is the best thing to try.
  11. I don't know why it would be running slower than when you recorded it. However, as Randall pointed out, there is a command to speed things up. Try the Macro Playback Speed. According to the help if you enter 0.5 in the 'Playback Factor' field the macro will run twice as fast. This causes the delays to be half as long. 0.25 will cause the delays to be one fourth as long. You may be able to use a scheduled macro. Perhaps something like this will work:Create a second macro that contains the commands that you want to perform after the 150 second delay. Make it a Scheduled Macro. Choose Other for the schedule and enter 150 seconds. Then disable the macro. Inside the main macro run up to the point where you want to begin the 150 second 'loop' and then add a Macro Enable command to enable the second macro. A scheduled macro will be more accurate than a macro loop but it too will not be exact. I agree with Randall: you should try the Windows Controls commands. The Windows Controls use the handles that Paul mentions. This is what I would try: I would launch the first instance of the program (or the first dialog within the same program) and then use the Capture Control command to get a control for that window. Then I would launch the second instance of the program and use the Capture Control command to get the control for that window. Be sure to use different control variables. Once you have these two control variables, you can do Alt+Tabs or maybe use the Window Activate command and then use the If Control Focused to see if the window you want has been focused.
  12. This macro is an example and would need to be edited for it to work. This macro does not involve Wordpad or Notepad. It reads the file into a variable, makes replacements in the string variable, and writes the content of the variable to a file. But, it is not complete. Note that I included in the sample macro replacements for 99, 98, 97, and then skipped to 32, 31, 30, 29, 28 and then skipped again to 12 through 1. Also, you will need to change the input file from test.txt to whatever your file is named. And you will need to change the output file to whatever you want. In my example, it does not show the name of the output file but I personally do not recommend that you use the same file for input and output. If the process fails in the middle, you may destroy your macro file. I created this macro using the Scripting Editor. Start by reading the tutorials. You can access the tutorial from within the help file. Click Help and then Macro Express Help. Then click the [+] next to the Tutorial Topic. You can then highlight each tutorial topic one at a time. If you haven't already, you should read the Quick Start Guide. Click Help and then Quick Start Guide. This explains that macros have something to activate them and the macro contains commands to perform different actions. The 'editor' and 'player' parts of the program are also described. When I enter a macro in the Scripting Editor I put the cursor in the Search box and then type the first few letters of the command I want. Then I hit the ENTER key to put the command into the macro script. For the sample macro I used the following macro commands: Remark Insert comments or remarks in the script. Variable Set String Read content of the text file into a variable (T1). Open the Variable Set String dialog, choose the 'Set Value from File' option and enter the filename and the variable (T1 through T99). Replace "99" with "ninety nine" in %T1% To enter this macro command you need to open the Variable Modify String dialog and choose the 'Replace Substring' option. Choose a variable, enter the appropriate information in the 'Text to Replace' and 'Replace With' fields. Variable Modify String Write content of a variable (T1) to a file. Opent the Variable Modify String command, click on the Option 2 tab, choose 'Save to Text File' and enter the filename and variable. Make sure you use the same variable for all these commands. I used T1 for this example.
  13. Something like this may work: // Read content of file into variable T1 Variable Set String %T1% from File: "test.txt" Replace "99" with "ninety nine" in %T1% Replace "98" with "ninety eight" in %T1% Replace "97" with "ninety seven" in %T1% // . // . Replace "32" with "thirty two" in %T1% Replace "31" with "thirty one" in %T1% Replace "30" with "thirty" in %T1% Replace "29" with "twenty nine" in %T1% Replace "28" with "twenty eight" in %T1% // . // . Replace "12" with "twelve" in %T1% Replace "11" with "eleven" in %T1% Replace "10" with "ten" in %T1% Replace "9" with "nine" in %T1% Replace "8" with "eight" in %T1% Replace "7" with "seven" in %T1% Replace "6" with "six" in %T1% Replace "5" with "five" in %T1% Replace "4" with "four" in %T1% Replace "3" with "three" in %T1% Replace "2" with "two" in %T1% Replace "1" with "one" in %T1% // Write contents of variable T1 to file Variable Modify String: Save %T1% to Text File
  14. Yes, it sounds like a bug. We'll reproduce it and fix it.
  15. Randall, Is there a macro in your recycle bin named DestinationXcopyGUI? Do you have more than one macro named DestinationXcopyGUI? Do you have any macros with similar names either as part of your main macros or in your recycle bin? if so, what happens if you rename or delete them?
  16. You're right. My bad. Shift + click on link brings up a new browser window. Sorry for the misinformation. Edit: Ctrl+click on a link in Firefox brings up the link in a new tab within Firefox.
  17. Sorry, no. You might be able to write some macros to detect when one of the txt macros has been altered but that might not help. If you are using Windows XP you could create a folder that your users can read from but not write to and put the .txt macros in it.
  18. Another approach would be something like this: Control Key Down Mouse Left Button Click Control Key Up
  19. If Macro Express finds at least one Control or Window activated macro it activates a loop that looks for the specified Windows Control or Window every 1/4 second. This does use CPU time. On faster computers this is not noticable. However on slower computers this can have a noticable effect. The more windows you have open on your system, the longer it will take Macro Express to perform the check. Note that not all windows are visible and even hidden windows are examined by Macro Express. There are utilities you can use to view the windows or you can use a simple macro to do this using Repeat with Windows macro command: Activate or Launch: "notepad" OR "notepad.exe" Repeat with Windows: Place title in %T1% Text Type: %T1% Repeat End
  20. If the problem is caused by "page loading time differences" then the Wait for Web Page command should help. This command only works with IE, however. If you are using another browser, you might use the technique described here:http://pgmacros.com/community/index.php?sh...st=0entry2576. Others have had success writing a macro to watch the status bar of the browser and waiting for the word 'Done'.
  21. Randall: Any valid IP address will work. It can be the IP address for a device on your own network or the IP address of a web page. There is no trick to it. Just enter it into the Web Site command. My testing indicates that it doesn't matter if the http:// portion is included or not. pthomass: To verify the above for Randall I created this macro to log into a device on my network: Web Site: 192.168.0.2 [Default Browser] Wait for Web Page: "" Wait For Window Title: "Connect to xxx.xxx.xxx.xxx" Text Type: xxxxxxxxxxxxxx<TAB> Delay 0.1 Seconds Encrypted Text // this contains the password Text Type: <ENTER> Wait for Web Page: "" Sound Wave File: DoneF1.wav // Say 'done' when IE is no longer busy
  22. You may need to slow the macro down to determine what is going on. I generally insert some delay commands around each step. At first I set the delays fairly long. Once the macro is working, I slow it down by adjusting the delays. Also, you might want to try the Wait for Web Page command. Something like this may work: // Load IE, enter the ip address and wait until IE is no longer busy Web Site: 192.168.0.99 [Default Browser] Wait for Web Page: "" // Do a long delay for now Delay 10 Seconds // Enter login name Text Type: <login name> Delay 1 Seconds Text Type: <TAB> Delay 2 Seconds // Enter password Text Type: <login name> Delay 1 Seconds Text Type: <ENTER> Delay 2 Seconds After you make sure the macro works, reduce the delays. You might wind up with something like this: // Load IE, enter the ip address and wait until IE is no longer busy Web Site: 192.168.0.99 [Default Browser] Wait for Web Page: "" // Do a short delay Delay 1 Seconds // Enter login name Text Type: <login name> Delay 0.1 Seconds Text Type: <TAB> Delay 0.1 Seconds // Enter password Text Type: <login name> Delay 0.1 Seconds Text Type: <ENTER> Delay 0.1 Seconds or maybe even this: // Load IE, enter the ip address and wait until IE is no longer busy Web Site: 192.168.0.99 [Default Browser] Wait for Web Page: "" // Enter login name Text Type: <login name><TAB> Delay 0.1 Seconds // Enter password Text Type: <login name><ENTER> Delay 0.1 Seconds You didn't mention what you are using to activate the macro. If you are using a Window Activated macro then you may need to adjust the macro to prevent multiple activations.
  23. If Macro Express will be using the HKLM area of the registry for that user then yes, you can edit the preferences for that user. However, if the user is not an administrator (or in some cases a Power User) then no, you cannot edit that part of the registry. The HKEY_CURRENT_USER portion of the registry is contained in a separate file. A separate and unique file is loaded for each user that logs in. To my knowledge, this prevents an administrator making changes to the HKCU portion of the registry for a specific user. The default registry settings are built into Macro Express itself. When it tries to read a setting from the registry Macro Express will provide a default value if it doesn't exist. However, there is a way to get around this: Log on to a test machine as an administrator Install Macro Express on the test machine Click Options and then Preferences Change the preferences the way you want them (do not click the OK button yet) Toggle 'All users use the same settings' found under Options, Preferences, Miscellaneous. Click the Apply button Toggle 'All users use the same settings' again, returning it to its original value Click the OK button Click Tools and then Export Program Configuration Save the Program Configuration into a file named defprefs.mcf Put a copy of the file defprefs.mcf into the folder where the Macro Express program files are installed The first time a new user loads Macro Express they will be using the preferences defined in the defprefs.mcf file. This only works the first time. During subsequent uses Macro Express will find the preferences in the registry and use them. You may also change the shortcut that loads Macro Express to include the /IC<filepath> option. This will tell Macro Express to use the settings contained in the file specified by the /IC command. To use this technique you need to export the program configuration into a file similar to the steps listed above. The trick, however, is keeping Macro Express from overwriting the shortcut you create to load it. If Macro Express overwrites the shortcut it will remove the /IC command line parameter. Macro Express will overwrite the shortcut if the Run on Windows' Startup preference is set and any of the preferences are changed.
  24. The Macro Express preferences are by default stored in: HKEY_LOCAL_MACHINE\SOFTWARE\Insight Software Solutions\Macro Express However, if the logged on user does not have 'write' privledges to the HKLM area of the registry or if the 'All users use the same settings' option found in Options, Preferences, Miscellaneous is unchecked, then the preferences are stored in: HKEY_CURRENT_USER\SOFTWARE\Insight Software Solutions\Macro Express There is a macro command that returns the registry key that Macro Express is currently using for the preferences. Try the Variable Set From Misc / Set Variable %T1% to "Preferences Registry Key" command.
  25. Even though you are not using environment variables now, I thought it wise to finish this discussion for others who use environment variables in the future. Yes, 32K is the limit for all environment variables together. Your system defines a number of environment variables. The easiest way I know to display them is to open a DOS Command Prompt. Click Start, Programs, Accessories and then Command Prompt. Inside the command Prompt window type set followed by the ENTER key. A number of environment variables will be displayed including things like this: ALLUSERSPROFILE=C:\Documents and Settings\All Users APPDATA=C:\Documents and Settings\XXXXXX\Application Data CLIENTNAME=Console CommonProgramFiles=C:\Program Files\Common Files COMPUTERNAME=XXXXXX OS=Windows_NT Path=C:\Program Files\xxx;C:\Program Files\xxxl\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\xxxx; PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 15 Model 2 Stepping 5, GenuineIntel PROCESSOR_LEVEL=15 PROCESSOR_REVISION=0205 ProgramFiles=C:\Program Files PROMPT=$P$G SESSIONNAME=Console SystemDrive=C: SystemRoot=C:\WINDOWS But, on most computers, the number of environment variables defined by the system would not come very close to the 32K limit. It is possible that something inside your data is causing a problem. As I mentioned, environment variables are designed to accept string data that does not include non-displayable characters. Depending on the source, some string data contain things like the ASCII NUL character (00 hex) that you cannot see.
×
×
  • Create New...