Jump to content
Macro Express Forums

Samrae

Members
  • Posts

    452
  • Joined

  • Last visited

  • Days Won

    22

Everything posted by Samrae

  1. The 'Macro Playback Speed' has the effect of adjusting all the delays in your macro. Entering 0.1 in the 'Playback Factor:' has the effect of speeding up the macro by 10 times. All delays of 500ms run at 50ms. You could do a bulk replace in the Direct Editor. Do this to change all 'Delay 10 Milliseconds' command to 'Delay 1 Milliseconds': Click the Direct Editor button Click at the beginning of the macro Press Ctrl+R to bring up the Find/Replace dialog Enter <MSD:0010> in the 'Find what:' field Enter <MSD:0001> in the 'Replace with:' field Click the Replace All button To remove all 10ms delays search for '<MSD:0010><' and replace it with '<'. When I create a macro that I am going to use more that a few times I spend some time to optimize it. One thing that I do is to use variables for the delays. Variable Set Decimal %D1% to 0.025 Variable Set Decimal %D2% to 0.1 Variable Set Decimal %D3% to 1.0 // Some macro commands // Short delay Delay %D1% Seconds // Some more macro commands // Medium delay Delay %D2% Seconds // Even macro commands // Long delay Delay %D3% Seconds Then, if I need to change the delays I only need to change them at the top of the macro.
  2. Here is a sample macro that may get you started. (Download this macro by clicking on the filename below.) // ----------------------------------- // Make choices // ----------------------------------- Multiple Choice Menu: Symptoms Clear Variables // Clear the variable array, just in case the Symptoms variable is reused Split String "%Symptoms%" on ", " into %SymptomArray%, starting at 1 // Split each choice into a separate element of an array variable // Loop through each element of the array variable and assemble the output into the Symptoms2 variable Repeat Start (Repeat 50 times) Variable Set Integer %IdxPlus1% to %Idx% Variable Modify Integer %IdxPlus1%: Increment If Variable %SymptomArray[%Idx%]% Does not Equal "" // If this element of the array is not empty If Variable %Symptoms2% Equals "" // Is Symptoms2 empty? Variable Set String %Symptoms2% to "%SymptomArray[%Idx%]%" Else If Variable %SymptomArray[%IdxPlus1%]% Equals "" // If the next element is blank we know the current element is the last one // Handle the last item Variable Set String %Symptoms2% to "%Symptoms2% and %SymptomArray[%Idx%]%" Repeat Exit // Last item processed, exit the repeat loop Else // Add this item to the list Variable Set String %Symptoms2% to "%Symptoms2%, %SymptomArray[%Idx%]%" End If End If End If End Repeat // ----------------------------------- // Display result // ----------------------------------- Text Box Display: Result Sample-Multiple Choice And.mex
  3. MacExp.exe is the process for the Macro Express Pro - Player. MacEdit.exe is the process for Macro Express Pro - Explorer. MacScript.exe is the process for the Macro Express Pro - Script Editor. If you are setting the scope of a macro to only run when MacExp.exe is on top it will never run. This process is always hidden. It can never be on top or have focus. Try setting the scope to MacEdit.exe or MacScript.exe depending on which process your macro is written for.
  4. Here is what I do: 1. Double-click the macro I want change 2. Click on Activations tab 3. Double click on the HotKey activation that appears in the upper left corner. 4. The Select a HotKey dialog comes up. Choose another HotKey. 5. Click the OK button.
  5. There are a few ways to do this. Here is what I suggest: Variable Set String %Choice% to "CANCEL" // Set a default value for the Choice variable used in the Multiple Choice Menu command Multiple Choice Menu: Choose something // use %Choice% for the Destination Variable If Variable %Choice% Equals "CANCEL" // The CANCEL button was clicked End If If Variable %Choice% Equals "A" // Option A was chosen End If If Variable %Choice% Equals "B" // Option B was chosen End If In the On Error tab of the Multiple Choice Menu command look for "The dialog was cancelled" and choose "Ignore Error". Of course you will need to change the If statements if you use the "Save Item Text" and/or "Multiple Choice" options in the Multiple Choice Menu command
  6. Use Alt+Left Arrow to move to the Favorite Commands / Code Snippets / All Commands pane (depending on which is selected) Use Alt+Right Arrow to move to the Script area (line code area) Use Alt+Down Arrow to move to the Search for Command box Once you highlight a command on the left, if you press the ENTER key it is inserted on the right side (the script area). You can choose where the commands are inserted by clicking Options and choosing "Insert Command Before Selected", "Insert Command After Selected" or "Add Command to End of Script". The way I do this is to open a new, blank macro in the Script Editor, click Snippets, click on the snippet to put it in the script area, edit it, highlight it and save it as a Snippet. I am not aware of another way to do this. When writing macros I use the Search box extensively. For example, when I want a Text Box Display command I press Alt+Down Arrow, "text box d" and ENTER. I don't always type the entire thing. I may type "tex" and Down Arrow and then ENTER. I do not use Favorite Commands because I can search for my favorite commands so quickly.
  7. To clarify, that is the Notification Area of the Taskbar. Microsoft changed the name of this area. It was formerly known as the System Tray. To access programs in the Notification Area / System Tray you can use the "Move Mouse to Tray Icon" command. After the mouse is moved you can right-click or left-click the mouse to activate the menu associated with that icon. Note, however, that the "Move Mouse to Tray Icon" command does not work with icons that are hidden by Windows. To get around this Windows allows you to select which icons are hidden (although I have had mixed results with this).
  8. I'm not sure where you saw that introduction but I do know that the PGM Functions are now free. A password will not be required, even after 30 days.
  9. When did you download the PGM Functions Library? Is the latest freeware version password protected?
  10. I tried this and macros ran fast while in Safe Mode but the delay returned when I booted into normal mode. Adding macexp.exe to the Windows Defender Exclusion list worked for me.
  11. It doesn't look like you can hide the Category pane but you can drag it to make it much smaller. Move your mouse over the bar between the Category and Macros panes until the mouse cursor changes. Then hold down your left mouse button and drag it to the left. Macro Express Pro will remember the size.
  12. You mentioned "CMD (ADMIN) window". If your cmd prompt is running as administrator then you must run Macro Express as administrator. Windows will not allow a program running with non-admin privileges to type into a program running with admin privileges.
  13. Doesn't the Text Type command work in the Command Prompt? What version of Windows are you using?
  14. The sample macros (samples.mex) contain a list of variables that are used in remarks at the top of the macro. For example: // Variables used: // T1 - Selection made in Multiple Choice Menu command // T2 - A message for the Text Box Display command // T3 - Windows version selected in Multiple Choice Menu It is a little bit of work to do but a list like this sure helps when you edit the macro in the future. I like the named variables in Macro Express Pro. It makes knowing which variables that are used a lot easier. It also makes it less necessary to know what variables are used.
  15. Here are two more to consider along with Alan's great suggestions: 6. Change the size of the browser window to allow reliable positioning of elements in the browser. Then use mouse clicks on known locations. If necessary, you can save the size of the window at the top of the macro and restore it at the end. 7. Alan mentioned using <SHIFT><TAB> (back tab). I have found that in some cases this can be more reliable rather than tabbing forward through the fields in the browser window. Something like this: Text Type: <ALTD>d<ALTU> // Move to the address field of the browser Repeat Start (Repeat 44 times) Text Type: <SHIFTD><TAB><SHIFTU> // back tab Repeat End
  16. On a VMWare virtual machine running Macro Express Pro I created a macro that writes to a log file every second. When the VMWare session was minimized, the macro kept running. When I logged off of my workstation the macro kept running in the VM. It looks to me like it will do exactly what you trying to do. Note, however, that since the VM is like a separate computer, you would have to install MS Access on it to have it continue to process things. Macros running on the VM do not automate programs or tasks on your host computer.
  17. Have you considered using a Virtual Machine (VMWare, Virtual PC, HyperV, Virtual Box, etc.)? Macros and other tasks continue running as long as the virtual machine is running, even if the VM window is minimized. If the VM is running on a server it will continue to run even if your workstation is not connected to it.
  18. After your macro performs a Get Control command you can follow it with one of these commands. If Control %C1% Focused If Not Control %C1% Focused If Control %C1% Visible If Not Control %C1% Visible If Control %C1% Enabled If Not Control %C1% Enabled Macro Express Pro contains additional options: If Control "%cDialog%" Exists If Control "%cDialog%" Does Not Exist If Control "%cDialog%" is visible If Control "%cDialog%" is not visible If Control "%cDialog%" is focused If Control "%cDialog%" is not focused If Control "%cDialog%" is enabled If Control "%cDialog%" is disabled Note that not all of these commands work for every control. It depends on how the program you are automating works.
  19. There are macro commands to copy to and from the clipboard. Try something like this: Variable Set String %Temp% to "This is a test." Variable Modify String: Save %Temp% to the clipboard The Text Type command has an option to "Use Clipboard and Paste Text". By default this is set to "Simulate Keystrokes". Using this option you don't even need to use the Variable Modify String command. Sometimes I want to keep the text on the clipboard so I have my macro save and restore it, like this: Variable Set String %ClipboardSave% from the clipboard contents // Save the content of the clipboard Variable Set String %Temp% to "This is a test." Variable Modify String: Save %Temp% to the clipboard Variable Modify String: Save %ClipboardSave% to the clipboard // Restore the content of the clipboard
  20. There are many shortcuts in Windows that can be used in macros. Here is a page with the current list of Windows Keyboard Shortcuts.
  21. That depends on what the upload window looks like and how it works. Ask yourself, what should I type in the upload window to select more than one file? Once you answer that you can create a macro to perform those actions.
  22. PotterHarry: Your macro looks like it was written in Macro Express 3. Is that the case? Are you aware that this is the Macro Express Pro forum and there is a separate forum for Macro Express 3? You will get better help if you post in the correct forum. I echo Cory's comment. It seems dangerous to write to HKEY_CLASSES_ROOT. That area should be reserved for Windows. If you want the values to be accessible to only one user, write to the HKEY_CURRENT_USER area of the registry. Perhaps here: HKCU\Software\Macro Express Variables\ If you want the values to be accessible to every user of a specific computer, write to the HKEY_LOCAL_MACHINE area of the registry. Perhaps here: HKLM\Software\Macro Express Variables\ To help others help you, copy your macro to the clipboard and paste it into a quote box in this forum. To make it even easier, copy your macro using the Command Text menu option and paste it into a another quote box. It will look like this: Putting macro commands in a quote box allows them to be copied and pasted into our macro files without formatting errors. If the macro appears in the forum text the wrapping and formatting make it difficult to copy and paste. You can also, as Cory suggested, attach a macro file, either a .mex or .mxe, to your post.
  23. Try something like this: You may or may not want to round the decimal value before converting it to an integer. If you do not care about rounding it you can leave out the "Variable Modify Decimal: Round" command. When trying this out I discovered a bug. When variable names, that do not already exist, are entered into the "Value 1" and "Value 2" fields of the "Variable Modify Decimal: Multiply" command Macro Express Pro only offers to create them as Integer or Large Integer variable types. It should also offer to create them as Decimal variables. To get around this you can either use the Variables tab to create the variables or you can use "Variable Set Decimal" commands to create the Decimal variables and give them a value. Something like this would work: I will be reporting this bug to Insight Software.
  24. If you are using a 64-bit version of Windows you will need to use "C:\Program Files (x86)\Macro Express Pro" instead of "C:\Program Files\Macro Express Pro". Macro Express Pro can have multiple macro files loaded at the same time. The /A command line parameter can be used to specify the macro file along with the macro to run. This is what worked for me. Create a batch (runmacro.bat) file containing this: You will need to adjust the path to your macro file (c:\Macros\Test4.mex above). You may need to adjust the path to where Macro Express Pro is installed. As Paul mentioned, you could use meproc.exe instead of MacExp.exe. Create a macro that looks like this: You can copy and paste it from here:
  25. Can you highlight the web page and then copy it to the clipboard? Another approach is to save the web page to a file and then parse through the html. The later is a bit involved, however.
×
×
  • Create New...