Jump to content
Macro Express Forums

Samrae

Members
  • Posts

    452
  • Joined

  • Last visited

  • Days Won

    22

Posts posted by Samrae

  1. The playback speed is supposed to be active for a macro thread. A macro is activated, does a bunch of stuff and ends. If the "bunch of stuff" includes a Macro Run command, it is still part of that macro thread.

     

    I use macros that profile the workstation to determine its screen resolution and how fast or slow it is. It then adjusts things like X, Y coordinates and playback speed accordingly. This profiling is done in a separate macro called by the Macro Run command. This technique will only work if the playback speed is set for an entire macro thread.

     

    I say it is not a bug. It is an important feature.

  2. Will Copy and Paste command work? Note that you can highlight something, copy it to the clipboard and then save the content of the clipboard in a variable. If you repeat these steps you can save several bits of informatino in variables. Then you can type the information from the variables in the appropriate fields in your destination app.

     

    Look at these commands:

    Clipboard Copy
    Variable Set String %String1% from the clipboard contents
    Clipboard Paste

  3. Use "Last name:" in a "Variable Set Integer %Idx% to the position of" to mark the end of the first name. If nothing appears after the last name but spaces you can get all the characters and then use the "Variable Modify String %sTemp%: Trim" command to remove any leading and trailing spaces.

     

    Start with the sample provided and try it. See what happens and see where you need to adjust the macro. If you get stuck post your macro for others to help.

  4. If you have the entire page in a variable you can use the "Variable Set Integer to the position of" command to search for something in front of the name and something after the name. Something like this might get you started:

    Variable Set Integer %Idx% to the position of "First Name:" in %sTemp% // Find "First Name:" in the input string
    Variable Modify Integer: %Idx% = %Idx% + 10 // Adjust the idx to skip over "First Name:"
    Variable Modify String: Copy a substring in %sTemp%, starting at %Idx% and 99999 characters long to %FirstName% // Copy from the first name to the end of the string
    
    

    This is not complete. You will have to determine what characters follow the First Name and then do another Variable Modify String: Copy a substring command.

     

  5. The November 12, 2012 issue of the Macro Express News email newsletter talks about this. It says:

     

     

    In order for macros to run, Adobe’s Protected Mode feature must be turned off.

     

    Follow the steps below to turn off Protected Mode in Adobe Reader X and XI:

    • Open Adobe Reader
    • Click Edit, Preferences
    • For Adobe Reader X click General or for Adobe Reader XI click Security (Enhanced)
    • Click to uncheck the "Enable Protected mode at startup" setting
    • Click the OK button to save
    • Restart Adobe Reader

     

    You can read the entire newsletter issue here.

  6. The number appended to the end of the log file name is the index of the macro that was activated, even for macros called via the Macro Run command. If Macro_A has an index of 45 and Macro_B has an index of 38, when Macro_B is activated by itself the log file is named Macro_B38 but if Macro_A runs Macro_B via a Macro Run command the log file for Macro_B is named Macro_B45.

  7. Are these files in one or only a few folders? If so, I would use the Repeat with Folder command. Something like this may get you started:

    // Get Path to My Documents
    Set Variable %T1% to "Path to My Documents"
    Change Directory/Folder: "%T1%"
    
    // Rename each file in the folder, one at a time
    Repeat with Folder
      Variable Set From File Path
      Rename File or Files: "%T2%"
    Repeat End
    

    Copy this code and paste it into your macro:

    <REM2:Get Path to My Documents><VSETMISC:T1:Path to My Documents><DOFILE:01:NN:%T1%>><REM2:><REM2:Rename each file in the folder, one at a time><REP3:07:000001:000001:0002:0:01:%T1%><VFFILE:1:T:10:T:11:T:12:T:13:%T2%><DOFILE:06:NN:%T2%>%T12%%T13%><ENDREP>
    
  8. Click the Macro Recycle Bin button and delete any macros listed there.Check to see if the Ctrl+N macro runs. If not, then you should download the latest version of Macro Express 3 from www.macros.com/download.htm and install it. Some earlier versions of Macro Express 3 would still run macros when they existed in the Macro Recycle Bin.

     

    If the Ctrl-N macro still runs after emptying the Macro Recycle Bin then you could identify which macro is still running by systematically disabling groups of macros.

     

    Start by creating a new macro file by clicking File, New Macro File. This will disable all of your existing macros. Don't worry, you will be able to get them back. Make sure that Ctrl-N is no longer running a macro.

     

    Click File, Reopen to reopen your original macro file.

     

    Sometimes macros have multiple activations but only one activation is indicated in the Macro Explorer window. If this is the case you could try disabling the top half of your macros. See if the Ctrl-N macro no longer runs. If it still runs, enable those macros and disable the bottom half of your macros. Once you have identified a set of macros that contain the Ctrl-N macro you can narrow down your search. Disable a smaller and smaller number of macros until you identify the macro.

  9. I thought Macro Express Decimal Variables were Floating variables:

    From the Macro Express Pro help:

    A Decimal variable holds any type of number, such as 12.432 or -1.3. Note: A decimal variable value can range from 5.0 x 10^ -324 to 1.7 x 10^308 with 15 to 16 significant digits. This first example is a decimal expanded to include 324 leading zeros followed by the number 5, represented as .000(321 more zeros)5. The second range extends to 17 followed by 308 zeros which would look like 1700000000(300 more zeros).0. The numbers are rounded to 15 or 16 significant digits.


    Compare with the Wikipedia description of Floating Point variables.

     

    Macro Express does not, however, support scientific notation like 0.001017654 × 10^5.

  10. AtinK: You could use the Windows Task Scheduler to run a macro. When you define a task in the scheduler you can specify that it needs to log in to perform the task. For the process you can either specifiy the Macro Express Player (macexp.exe) or the smaller launcher (meproc.exe) and use a parameter that looks something like "/AYourMacro".

    Cory: After reading your critique of AtinK's macro I decided to look at it. For anyone else interested, here it is in human readable form:

    If Program "XYZ" is running
      Terminate Process: XYZ
    End If
    Delay: 5 seconds
    Launch Program and Activate Window: Program "XYZ.exe", Parameters "", Window "XYZ"
    If Not Program "XYZ.EXE" is focused
      Window Activate: XYZ
    End If
    Window Activate: XYZ
    Delay: 3 seconds
    Text Type (Simulate Keystrokes): username
    Delay: 2 seconds
    Text Type (Simulate Keystrokes): <TAB>
    Delay: 2 seconds
    Text Type (Simulate Keystrokes): password
    Delay: 2 seconds
    
    

    Cory, I rarely disagree with your analysis but in this case ...

     

    AtinK, The only change I would make is to remove the second "Window Activate" command. That one IS unnecessary. The remainder of the macro I would leave as is until I was certain that it worked. This macro looks just like how I would write it before optimization. Once the macro is working you can either reduce the amount of delay or combine "Text Type" commands.

     

    For the record, this:

    If Not Program "XYZ.EXE" is focused
      Window Activate: XYZ
    End If
    

    is a published trick to speed up your macro. The "Window Activate" command takes a relatively long time to perform. By checking you can you can avoid the Window Activate command if the window is already focused.

  11. When Macro Express Pro loads up it checks to see if another instance of Macro Express Pro is already running. If it is then the new instance terminates. You cannot run two instances of Macro Express Pro in the same session.

    Paul, is it possible for a process running in one session to see the process from another session? I thought they were independent of each other.

     

    Edit, I see from Cory's response that .NET can see processes from other sessions.

  12. The Terminal Services Session ID command will tell you if you are using the Console or some other session. Could you use that information? Perhaps write it to a file. When a macro starts have it compare the current Session ID with the Session ID in the file. If they match you know that Macro Express forgot to clear the flag the last time it ran. If they do not match you know another session set the flag.

     

    Or, you may just decide to run the macros from the console session. I think the console session is always 1.

     

    What conflicts? Do you need a unique filename? If you include the Session ID as part of the filename you could ensure that you have a unique file for each session.

×
×
  • Create New...