Jump to content
Macro Express Forums

kevin

Admin
  • Posts

    1,950
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by kevin

  1. What you are observing is that Microsoft treats different keys in different ways. Most function keys are sent to the 'hook chain' before being acted on. But when you press the F1 key in some programs, the help dialog is displayed and then the F1 keystroke is sent to the 'hook chain'. The result of this is the help comes up and then a macro assigned to the HotKey F1 runs. To see the difference, create two macros, one with a HotKey activation of F1 and the other with the HotKey activation of F3. Load Internet Explorer and press F1. The IE help dialog comes up and the macro runs. Now press F3. The macro runs but the IE Find dialog does not come up. Now, load Firefox and repeat the test. In Firefox when you press F1, only the macro runs. Macro Express relies on keystrokes sent via the 'hook chain'. Macro Express cannot control what happens before it receives the keystroke from the 'hook chain'.
  2. jmkeuning, You could Maximize a window, and then have a macro that uses the Window Resize command to make it a little smaller in width. Or, you could calculate the screen size using the Variable Set Integer from Screen Width and Variable Set Integer from Screen Height commands and use the Window Resize command to set it to the correct size in the first place. You can set the position of a popup menu as long as you are using the Icons Only, First Part of Macro, or Nickname and Scope styles. Set the X and Y values in the Properties dialog for the popup menu. If you are using the Windows Default style, then you cannot control the position.
  3. You could use two separate Variable Set String from Prompt commands and then combine the results. We realize that this isn't as convenient as having a single prompt for more than one line. The request has been made to add this to a future version of Macro Express.
  4. There are several ways to save and restore variables. Here is a sample: // 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"
  5. I had to do some checking. Here is the word I got: If a scheduled macro is set to run but another macro is running, then the second macro is queued up to run as long as it is not already in the queue. When the running macro finishes, Macro Express starts to service macros that are in the queue.
  6. I would capture the entire email by copying it to the clipboard. Then I would parse out the pieces I needed and put them in separate variables or a .csv file. The goal would be to only switch back and forth once between the email and the web page.
  7. Thanks for pointing out that the requirements are different.
  8. Rachel said: Can UltraEdit read and edit Word Document format files? It seems that Linda's requirements differ from Rachel's. Thank you Lars for pointing out that Word is not what Linda would want to use.
  9. In the Capture Window Control there is a checkbox titled 'Get Control Using Text'. From your description, this was checked when you captured the control information. Try unchecking it and capturing the control information again.
  10. I have a macro that does the first half of that. It attempts to read a value from the registry. If it is not found, then the macro asks the user for it. After the user has entered it once, they do not have to enter it again. You could take this one step farther by saving the an integer in the registry. Each time the macro runs it could read the value, increment it, and save it back into the registry. Then you could ask for the first value again when this integer reaches 10.
  11. You may not need the .000, .001, etc. files. If you are orgainized, all you need is your main macro file. For example, if you are using the macro file macex.mex then just copy it back and forth. The only problem is trying to remember which one you updated last. Of course, if you use more than one macro file, like I do, then you need to copy all of them.
  12. A playable macro has the extension of .mxe, not .mex as you described and a playable macro contains only one macro. If you attempt to export several macros to a playable macro you will be prompted for a name for each one. Have you searched your hard drive of other files with .mex or .mxe extensions? It is possible that a copy of your macro file is hiding out somewhere.
  13. The Windows API used to write to and read from an INI file to imposes a limit of 64K per file. I have not heard of a 10K limit but I rarely use INI files.
  14. No. I recommend that you have your macro do something that your VBA app looks for such as create a file, change the content of a file, or write something to the registry or clipboard. Have your VBA app loop until the 'something' occurs. But, make sure you program a timeout so if the macro fails to write the 'something' that your VBA app doesn't lock up.
  15. What's that last thing at the end? A typo. This should have been meproc.exe /AMacroName /VT1:Variable One /VN23:150 /VD6:22.23 Thanks for pointing out this error. To avoid confusion for other readers I edited the orginal post.
  16. Is it possible that the clipboard contains a space in front of or after the 'Z'? This would be difficult to determine and would cause your macro to fail. You could either read the clipboard into a variable and then trim off any spaces or you could do an If Clipboard Contains instead of If Clipboard Equals command. Another idea. It looks like your macro was first created by 'Capturing' it. What happens if you recapture the macro? One last idea: Have you updated the Java Runtime Engine (JRE)? Some versions work better than others with macro programs. You mentioned that the colors changed. Was this a result of updating the JRE or was it a result of the application being updated?
  17. You may be able to use the Window Controls commands. However, if the application is not allowing you to copy from the field into the clipboard then the field may not be defined as a Window Control. The only way to tell is to try it.
  18. This is possible using the MEProc approach to launching macros along with using the /V command line option. If you use this technique then you will need to add a Variable Restore All or Variable Restore Text command to read the values passed from the command line. At this point in time, there isn't an API message to pass variables. Again, starting MeProc.exe involves the hard disk. And if, for example, your VBA code is looping through a long file processing each line, you could be invoking MeProc.exe a zillion times. But in many cases, and for a non-real-time application, I'm sure it's perfectly serviceable. You have hit on the reason for MEProc in the first place. The executable file for the Macro Express Player is named MacExp.exe. The command line parameters to invoke macros (/A) or to pass parameters (/V) work with MacExp.exe or MEProc.exe. However, since MacExp.exe is over 3M in size and MEProc.exe is only 159K, MEProc.exe can be loaded much faster than MacExp.exe. Just how much faster depends on the speed of your computer, the speed of your hard drive, and whether or not the executable is cached by Windows. So, if you need to run a macro where speed is not an issue, then you could use (not necessarily recommended): macexp.exe /AMacroName /VT1:Variable One /VN23:150 /VD6:22.23 (edited) If you need to run a macro where speed is a little bit of an issue then you could use (recommended): meproc.exe /AMacroName /VT1:Variable One /VN23:150 /VD6:22.23 (edited) But if you need to run a macro (or macros) and speed is a big issue then you need to use the API calls. Before calling the macro you need to save the variable values in the Registry, or in an INI, TXT or CSV file. When (or if) Windows caches the meproc.exe file, the speed difference between techniques may not be much of an issue.
  19. Would something like this work? // 'Variable to Receive First Field' is set to T1 ASCII File Begin Process: "names.txt" (ASCII Delimited Text ) // Make sure that 'Variable to Receive First Field' is set to something like T10 ASCII File Begin Process: "%T1%" (ASCII Delimited Text ) // Put macro commands here ASCII File End Process ASCII File End Process or, since each line of your names file only contains one field, you could use the Text File Begin/End Process command in the outer loop: // 'Variable to Receive First Field' is set to T1 Text File Begin Process: "names.txt" // Make sure that 'Variable to Receive First Field' is set to something like T10 ASCII File Begin Process: "%T1%" (Comma Delimited Text ) // Put macro commands here ASCII File End Process Text File End Process Be careful to make sure the variables used by the outside loop are not overwritten by the variables in the inside loop.
  20. Perhaps you could use the Scope properties to allow the HotKey activated macro to run only when a certain window or program is running. I also use another approach for one of my macros. When I press the HotKey the macro checks a series of window titles and/or program names using the If Window Title is on top and/or If Program Name is running macro commands. If non of the programs or windows are found, then I perform a TextType of the original HotKey. This works quite well for me.
  21. Could you enter the characters in Macro Express and have Macro Express enter them into the other program? Try the Variable Set String %T1% from Prompt command.
  22. There is an error in the help. The command sent to PostMessage should be WM_USER+20, not WM_APP+20 as documented. There was a version of Macro Express that used WM_APP+20 but when it was changed to WM_USER+20 the help file was not updated. This example should work for C++ HWND hwnd = FindWindow(“TMainWin”, “Macro Express Player”); if( IsWindow(hwnd) ) { for(int x = 0; x < strlen(s); x ++) PostMessage(hwnd, WM_USER + 20, s[i], 0); PostMessage(hwnd, WM_USER + 20, 0, 0); } else MessageBox(GetForegroundWindow(), “Macro Express is not running”, “Error”, 0); I created an application in Delphi that runs a macro using the Windows PostMessage API. If anyone is interested in an example written in Delphi that I know works, I can provide it.
  23. Another alternative would be to use Access to export you data into a .csv ASCII format. Then use the ASCII Text File Begin/End Process commands to enter the information into the new program. Something like this: // Add macro commands to launch your application here ASCII File Begin Process: "test.csv" (Comma Delimited Text ) // Add macro commands to open a New record // The variables T10, T11, T12, etc contain the information for this record. // There will be one variable for each field in in your record. // // Use Text Type commands to enter the information into your new database // You may need to enter them in a differnt order than they came out of Acess. Text Type: %T10%<TAB> Text Type: %T15%<TAB> Text Type: %T11%<TAB> Text Type: %T14%<TAB> Text Type: %T13%<TAB> Text Type: %T12%<TAB> Text Type: %T16%<TAB> Text Type: %T17%<TAB> Text Type: %T18%<TAB> Text Type: %T19%<TAB> Text Type: %T19%<TAB> // Add macro commands to save the record ASCII File End Process You may be able to combine the Text Type commands into fewer separate commands. You may need to insert delays between the Text Type commands or use the Keystroke Speed command. It is likely that you will need to give the program a moment to keep up with the data entry. You will likely need an even longer delay after saving the record. This technique does not require that you know how many records are in the original data to begin with. It also does not require that you switch between Acess and the new database.
  24. Rachel, What you want is the MS Word keystrokes to do a Search and Replace. In Word you would do the following to replace 'address' with an empty string: - Type Ctrl+f to bring up the Find dialog. - Type Alt+p to select the Replace tab. - Type 'address' in the 'Find what' field. - Type tab to move to the 'Replace with' tab. - Type the delete key to remove whatever is in the 'Replace with' field. - Type Alt+a to 'Replace All'. What Macro Express does it to automate what you normally type by hand. Here is an untested macro: Text Type: <CONTROL>f Delay 0.25 Seconds Text Type: <ALT>p Delay 0.1 Seconds Text Type: address Text Type: <TAB> Delay 0.1 Seconds Text Type: <DELETE> Delay 0.1 Seconds Text Type: <ALT>a Note the Delay commands between some of the commands. When you press Ctrl+f for example, it may take a moment for Word to bring up the Find/Replace dialog. As I mentioned, I have not tested this. You may need to experiment a bit to get it to work smoothly for you. Another alternative is to Capture a macro. When you Capture a macro you have the option to include the amount of time you take between keystrokes. This may be the most reliable but the macro will run more slowly than a macro written with the Scripting Editor. You might want to set the Scope so this macro only runs when MS Word is running. There might be a shortcut to bring up the Replace dialog. The command may be Alt+p but that is not working for me. You may want to search your MS Word help file to determine the shortcut. If there is a shortcut that brings up the Replace dialog you should be able to simplify the sample macro shown above.
  25. I can not think of anything beyond my original advice. To summarize: If you can discover the keystrokes, mouse movements and mouse clicks that do what you want then you should be able to write a macro. If the components are defined as Windows Controls then you can send keystrokes and mouse movements directly to the controls. Using Windows Controls is likely to be a bit faster.
×
×
  • Create New...