Jump to content
Macro Express Forums

stan

Members
  • Posts

    278
  • Joined

  • Last visited

Posts posted by stan

  1. In version 3, if the page is not found the macro halts. Macro Express Pro includes error handling to take care of these situations.

     

    You may be able to use the Get Pixel Color command to do what you need in Macro Express 3. You will need to determine a fixed position on the screen that changes colors after the page has loaded.

     

    Here's a sample of how this portion of the macro would look.

     

    Variable Set Integer %N1% to 0

    Variable Set Integer %N3% to 0

    Repeat Until %N1% = 1

    Get Pixel: Screen Coords: 100,100 into %N2%

    Wait Time Delay 1 Seconds

    If Variable %N2% = 186023

    **** steps you would take after the web page is opened.

    Variable Set Integer %N1% to 1

    End If

    Variable Modify Integer: Inc (%N3%)

    If Variable %N3% = 60

    Repeat Exit

    End If

    Repeat End

     

    Use the Mouse Locator in the Get Pixel command to find the coordinates and the color value of the pixel to check. Use the If Variable command to see if the color value matches. If it does, then the macro performs the steps it is supposed to take on the web page and then exits out of the Repeat loop because N1 is set to 1. If it doesn't, then the macro repeats the loop again, looking for the change.

     

    As in the example above, you might want to add a Wait Time Delay to check every so many seconds, rather than constantly checking. Use the Wait Time Delay rather than a standard Delay. This will free up CPU cycles during the wait time.

     

    The macro has a 2nd If statement. It is incrementing the value of N3 each time through the repeat loop. Since the example has a 1 second delay, the macro would exit out of the loop approximately 60 seconds after trying to find the web page.

  2. Just open Macro Express 3 and click on File | Import | Import Macros. Find the macro file and import the macro. A message will appear stating that the file is in an older format (if it is a version 2 file) and prompt you to convert the file to the newer file format. It should then show up in your list of macros.

  3. Actually the hex value is also available for display in Macro Express 3. You have to open Options | Preferences | Miscellaneous and click on the Advanced button to turn on this option.

     

    Currently there is not a way to display the hex value in a text box. I would suggest making a feature request. We can see some value to adding this ability to the program.

  4. If I understand correctly, here is one way to do what you need.

     

    Repeat with Folder

    Program Launch: "EXCEL.EXE"

    Wait For Window Title: "Excel"

    ***macro steps

    Window Close: "Excel"

    Repeat End

     

     

    Use the Repeat with Folder command to obtain the first file in the folder. Use the entire file path and save to a variable such as T1.

    Use the Program Launch command to launch Excel. Enter %T1% in the Program Parameters field to have the first file open when Excel loads. You may need to insert as "%T1%".

    Have the macro wait until the Excel window opens.

    Enter your text, etc. and save the changes - Text Type: <ALT>fs should save the file.

    Close Excel and finish with a Repeat End to loop back to the next file.

  5. Here is how I would approach this:

     

    1. Variable Set Integer %N1% to 0

    2. Repeat with Folder

    3. Variable Set From File Path

    4. Variable Set From File Path

    5. Variable Modify Integer: Inc (%N1%)

    6. Text File Begin Process: "renamefiles.txt"

    7. Rename File or Files: "%T1%"

    8. Text File End Process

    9. Repeat End

     

    Below is a description of what each step does:

     

    1. Set an integer variable to 0

    2. Select the folder that contains the files to be renamed. Select the full path and save the information to a variable such as T1

    3. Set the Drive letter of file T1 to a variable such as T2

    4. Set the file path of file T1 to another variable such as T3

    5. Increment the integer value by one each time through the repeat loop

    6. This reads the file name from the text file and saves it to a variable such as T4. Start processing on variable N1 and only process one record. The first time through the repeat loop, variable N1 is set to 1, so it will grab the first line of the text file.

    7. Rename the file T1. Rename it as %T2%%T3%%T4% - This provides the original drive and file path plus the new file name taken from the .txt file.

    8. End the Text file Process loop

    9. Close the Repeat loop.

     

    The macro will rename the first file in the folder with the first name in the .txt file. It repeats to rename the second file with the second name in the .txt file and so on. You can modify this if you want to save the files to a new location.

     

     

    But, here is something to keep in mind. The Repeat with Folder command starts with the first file that Windows presents. This may or may not be the first file listed in Windows Explorer.

  6. Many of my shortkeys are not just for text replacement. They activate a wide range of macros in many different applications. The snag is that several of these applications use Space and/or Enter as important shortcut keys of their own. For example, most video editors use Space to stop/start playback of a clip.

     

    To get around this, select the Use Punctuation Characters option for Suffix keys. Then you can type a comma, period or other punctuation characters to activate the macro rather than pressing the Space Bar or Enter key.

  7. Terry,

     

    Why not just use the Suffix key option instead of a Prefix? The suffix option eliminates the problem you are running into. You can type me <Space>, meb <Space>, mep <Space>, etc. without any firing off before you finish typing the shortkey.

     

    You would need to be careful with using actual words as shortkeys, such as me. In those cases change your shortkey to #me, me1 or similar, or avoid it altogether.

  8. Windows requires some time to process clipboard functions. I would suggest placing a small delay between the Clipboard Copy and Clipboard Paste commands. A quarter second delay should be sufficient. This will allow Windows time to process the clipboard.

     

    Depending on how long it takes to type the text after the first paste, you may also need to add a delay before the second Clipboard Copy.

  9. It may be that the Shift key is stuck down. Maybe a slight delay between the Shift Down and Shift Up would resolve this.

     

    From what you describe it sounds like you would be better off just turning on the two Caps Lock options in the Preferences. This will take care of the situation automatically. It won't matter if the user has the Caps Lock Key turned on or not. If you insert the text in all caps in the Text Type command, it will play back in all Caps whether you have the Caps Lock key on or off.

  10. If the window is an Excel window or similar, I would suggest having the macro open the GoTo feature and go to row 3 column 5. Then use the Text Type command to Shift and Arrow Right to highlight the 11 cells and copy the highlighted cells to the clipboard. Use the Variable Set String command and save the clipboard contents to a text string variable.

  11. Macro Express Pro treats the macros more like database. Each macro is assigned an index number, which the program uses for a number of routines to quickly locate the correct macro.

     

    When you create a new macro, it should fill in the next available hole in the index numbering. But there is not a way to do what you want, other than exporting all your macros to a new file and work from the new file. The new file index should show no gaps in the numbers, until you start deleting more macros than you create.

  12. I'm not aware of a blanket way to change the nickname.

     

    I suppose you could write a simple macro to right click on the first macro in the Explorer window, open the Properties window, change the nickname, save, move down to the next macro and repeat the steps until all are changed.

  13. Let's say macro 1 uses the Variable Save command and saves variable T1 to memory. Macro 2 is run slightly after the first macro. It also uses the Variable save command and saves a different value to variable T1. Macro 3 runs the Variable Restore command. The value saved to T1 in macro 2 is the value restored. It was the last variable saved and overwrote the value in macro 1.

     

    Global variables called in a Macro Run command use the values from the parent macro. They will not get confused with a separate running macro that uses the same variable name. In this case they each have their own sandbox to play in.

×
×
  • Create New...