Jump to content
Macro Express Forums

floyd

Members
  • Posts

    292
  • Joined

  • Last visited

Posts posted by floyd

  1. A mouse activated macro works like the "Or" part of your first question:

    Or, is Macro Express supposed to trap the click and pass on to the application only what the macro wants ...

    Are you saying that within Opera, a Shft+Left-click is used to open the underlying link in a new page? If so, then you might want to try a Delay of 500ms as the first line in the macro, then shift-down, mouse click, and a shift-up. Like so:

    Delay 500 Milliseconds
    Shift Key Down
     Mouse Left Button Click
    Shift Key Up

    <MSD:500><SHIFTD><LCLK><SHIFTU>

    The reason for the delay at the beginning is to allow the system some breathing time between using the mouse to activate the macro and then stuffing it with a "click" when the macro runs.

     

    Also, I would set macro to be scoped to the Opera window, which will prevent it from being accidently invoked when Opera is not running.

  2. One simple solution is to use the Get Pixel Color command. The Windows Explorer Search dialog has two buttons, Search Now and Stop Search. You can use this command to trap a pixel color at some point on the Search Now button, do the search, and then wait until the button is restored to its original color. This will work because the button is disabled during the search and is re-enabled afterwards. The steps:

    • Move mouse over a point on the Search Now button
    • Get Pixel Color at that position
    • Use the Mouse Left Button Click command to start the search
    • Inside an infinite loop ...
    • Delay for a second or two
    • Get the pixel color again
    • ... continue looping until the color is correct
    • Exit the loop

  3. Yes, that is what I meant.

     

    I do not notice any slow downs using the Macro Run command. BUT ... that might be because everything we do here involves the Macro Run command.

     

    Have you checked the cache setting (Options | Preferences | Caching)? We set ours to 4,096 ... which is probably overkill.

     

    Also, have you attempted to adjust the Macro Priority setting in the Registry? This is accessed via the TweakMe3.mxe utility. Here's a good explanation of it from the Macro Express Explained book:

    This integer value specifies how much time that Macro Express is allowed to use your computer's CPU/processor. The allowable range is 0 through 2,147,483,647. The default value is 1,000. Zero turns this feature off, which gives full priority to Macro Express. You will need to enter a "-1" in the dialog to turn it off, which is then converted and stored as a zero. A "1" gives the lowest priority to Macro Express. The higher the number the more priority is given to running your macros and conversely for the lower the number. Experiment with caution!
  4. Welcome to the forum!

     

    The answer to this is to wait for the next window to pop up rather than the "application" menu. Here is what I mean:

    Delay 250 Milliseconds
    Activate Window: "Program Manager"
    Wait For Window Title: "Program Manager"
    Text Type: VBS Edit
    Text Type: <APP>
    Text Type: r
    Wait Window Lose Focus: "Program Manager"
    Macro Return

    <MSD:250><ACTIVATE2:Program Manager><WAITWIN2:000000:000002:Program Manager><TEXTTYPE:VBS Edit><TEXTTYPE:<APP>><TEXTTYPE:r><WAITWLF2:000000:000005:Program Manager><MRETURN>

    The above example activates the Desktop and then sets focus to my VBScript icon. Then it uses the Application key rather than right-clicking the mouse button to activate the menu. Finally it activates the Properties window.

     

    Essentially we are waiting for any other window to gain focus other than the Desktop. This is done because the application menu is not capturable and application menus take different times to appear. So we push all of the keystrokes into the keyboard buffer, and then wait.

  5. You are correct that Macro Express does not directly implement xcopy features. It requires saving both the source and destination file dates in variables and doing some comparisons as you are looping through a folder.

     

    Xcopy is easily run using the Window's Run dialog or a DOS batch file.

     

    Which path to take is a matter of personal choice, parameters of the job, and expediency.

  6. Welcome to the forum!

     

    If it is true that you need to delete the first 5 and last 8 lines of a file and these numbers are fixed and each line ends with a CR/LF and that you do not need to rename them (i.e. they are to be overwritten) ... then you can use Macro Express to easily perform this task. Here is a sample macro:

    // T92 = Ascii CRLF
    Variable Set %T92% to ASCII Char of 013
    Variable Set %T1% to ASCII Char of 010
    Replace "%T92%" with "%T92%%T1%" in %T92%
    
    // Process each file in the folder. T1 holds the file name
    Repeat with Folder
     
     // Count the number of lines in the current file. T2 holds the current line
     // N1 holds the total number of lines in the file
     Variable Set Integer %N1% to 0
     Text File Begin Process: "%T1%"
       Variable Modify Integer: Inc (%N1%)
     Text File End Process
     
     // Append to a string each line in the current file beginning
     // with 6 and ending with 9 lines from the end of the file
     // N2 holds the number of lines to keep in T3
     Variable Modify Integer: %N2% = %N1% - 13
     Variable Set String %T3% ""
     
     Text File Begin Process: "%T1%"
       Variable Modify String: Append "%T2%%T92%" to %T3%
     Text File End Process
     
     // Now save the string. Overwrite the file.
     Variable Modify String: Save %T3% to Text File
     
    Repeat End
    Macro Return

    <REM2:T92 = Ascii CRLF><ASCIIC:92:1:013><ASCIIC:1:1:010><TMVAR2:21:92:00:000:000:%T92%%T92%%T1%><REM2:><REM2:Process each file in the folder. T1 holds the file name><REP3:07:000002:000001:0001:0:01:C:\Temp2><REM2:><REM2:Count the number of lines in the current file. T2 holds the current line><REM2:N1 holds the total number of lines in the file><IVAR2:01:01:0><BTFBEG:002:000001:000000:%T1%><NMVAR:08:01:0:0000001:0:0000000><BTFEND><REM2:><REM2:Append to a string each line in the current file beginning><REM2:with 6 and ending with 9 lines from the end of the file><REM2:N2 holds the number of lines to keep in T3><NMVAR:02:02:1:0000001:2:0000013><TVAR2:03:01:><REM2:><BTFBEG:002:000006:N00002:%T1%><TMVAR2:07:03:00:000:000:%T2%%T92%><BTFEND><REM2:><REM2:Now save the string. Overwrite the file.><TMVAR2:17:03:00:000:000:%T1%F><REM2:><ENDREP><MRETURN>

    I've also attached this example. Of course you will need to change folders and do testing before actually running the macro.

    SampleMacroToDeleteLines.zip

  7. Welcome to the forum ...

     

    These kinds of errors displayed by Macro Express when using the email commands are being passed back from Windows. They are not Macro Express errors. I did a Google search on this and found many explanations. This one seems to be a pretty good summation:

    It means that Windows reported that a connection attempt or idle connection timed out.

     

    If this error occurs during a connection attempt (eg in a VPOP3 - SMTP Client connection problem error message), then it means that Windows couldn't connect to the ISP mail server within a fixed time (the timeout limit is fixed within Windows itself). This problem can either mean that your ISP is having a problem, that you are connecting through a slow proxy (in this case, try increasing the Diagnostics -> Tuning, "Connect Attempt Count" or "Connect Retry Time" settings), or that your Dial-up connection is faulty.

     

    If this error occurs whilst a connection is in progress (eg in a VPOP3 - POP3 Client Problem error message), then it means that the connection was idle for a set time - this set time can be changed on the VPOP3 Diagnostics -> TCP/IP Tuning window.

  8. Here are some points to remember about Windows and Macro Express when creating macros:

    1. A window that is invisible to you and I may be visible to an application. There are very few instances in Macro Express where a window is not visible.
    2. An invisible window can be on top and/or have focus the same as a visible window.
    3. A window can be on top without having focus and vice versa.
    4. The command If Window On Top actually tests for the window having focus, and if it does not, it will return false whether it is on top or not. In other words, you can think of it as the If Window Has Focus command.
    5. A window that is minimized can still have focus, it depends on the state of the window that is next in the stack.
    6. Depending on how an application was written, the If Window On Top command works only on the top-level (parent) window and not on windows within windows.

  9. My understanding is that Macro Express works just fine with both Citrix and Terminal Services. However, you must be careful as to how the macro is programmed when working with thin-nets. For example, it may seem like your computer is doing the work when actually the Terminal Services server is doing it.

     

    You could be seeing something on the client side that is just an "image" of what the Terminal Server is actually doing. In other words, a real window or dialog may be being run, or even displayed, on the Terminal Server, but all you are seeing on the client side is an image of it ... there is no actual window running on your computer. It really depends on where Macro Express is loaded and which computer is doing the work.

     

    As to folders not being available when the connection is terminated, this makes perfect sense to me. It would be the same as attempting to access a folder on a local network when the server containing it is no longer available to the network.

     

    Because "the flow of the work" is different when using Terminal Services, I would strongly suggest that you contact support at Insight Software to go over your exact situation, and what is going wrong, so they can help you.

  10. Oh sure ... DOS programs like batch files are, after all, programs like any other program. This is really no different than calling any other MS program while passing it command line parameters. We are simply passing parameters to a "programmable" program ... something you create ... rather than a pre-written program like Excel, Word, and so forth.

  11. Another solution is to use the msinfo32.exe program.

    c:\Program Files\Common Files\Microsoft Shared\MSInfo\msinfo32.exe /report c:\Temp\printers.txt /categories +componentsprinting

    Here is a macro that will create a file of the printer names using the above program (mxe attached):

    // Program file
    Variable Set String %T1% "msinfo32.exe"
    Variable Set String %T2% "c:\Program Files\Common Files\Microsoft Shared\MSInfo"
    
    // Output file
    Variable Set String %T3% "printers.txt"
    Variable Set String %T4% "c:\temp"
    
    // Delete output file if it exists
    If File Exists "%T3%"
     Delete File or Files: "%T3%"
    End If
    
    // Launch program
    Program Launch: "%T1%"
    Wait for File Exist: "%T3%"
    
    // Strip the double-byte(?) characters
    Variable Set String %T5% from File: "%T3%"
    Variable Set Integer %N1% from Length of Variable %T5%
    Repeat with Variable using %N1%
     Variable Modify String: Copy Part of %T5% to %T6%
     Variable Set %N6% to ASCII Value of %T6%
     If Variable %N6% > 0
       AND
     If Variable %N6% < 127
       Variable Modify String: Append %T6% to %T10%
     End If
    Repeat End
    
    // We only want the printer section
    Variable Set Integer %N1% from Position of Text in Variable %T10%
    Variable Modify Integer: %N1% = %N1% + 9
    Variable Modify String: Delete Part of %T10%
    Variable Modify String: Save %T10% to Text File
    Macro Return

    Note that, for whatever reason, the output file is created as double-byte characters ... or some such thing. So there is a loop that removes any characters from the string that are not between ASCII 01 and ASCII 126 and then re-saves the file.

     

    The file that is created will still need to be processed. Hint: each "field" in each of the remaining lines is separated by a <Tab> character. You will only want the first field. Also, you will want to ignore the "header" line.

    SystemPrinters.zip

  12. How about if you create a shortcut link to the Printers and Faxes within the Control Panel and then use the Launch Program command to fire it off. This would at least get you a window containing all of the printer names. You could also do a search for one of the printer names in your Registry to find out which hives contain the printer names.

  13. Even though your original question was about the Post Message command ...

     

    Whatever choice is currently displayed in a particular combo box in a particular application is not being captured by Window Controls in version 3.0.4.1? Do I understand this correctly? Does it return a blank string, or no string at all (i.e. nothing)? I would suggest taking the following steps:

    1. Run the program up to the point that the combo box contains something
    2. Launch Macro Express
    3. Set %T1% to some value, say "AaBbCc"
    4. Capture the combo box to %C1%
    5. Add a Variable Get Control Text: %C1% to %T1% command
    6. Run the macro

    Variable Set String %T1% "AaBbCc"

    Get Control %C1% (Google Search: "combo box" - : Edit)

    Variable Get Control Text: %C1% to %T1%

    Macro Return

    Does %T1% still contain "AaBbCc" or has it been changed?

×
×
  • Create New...