Jump to content
Macro Express Forums

paul

Members
  • Posts

    1,049
  • Joined

  • Last visited

Posts posted by paul

  1. the question, have you been able to create a toolbar to imbed into I.E. so a person could click on a button an invoke a ME-P macro? I would like to create a group of custom buttons that perform ME-P tasks. I'm not a programer but it seems this should not be very hard. Of course the voices in my head tell me I should fear soda can pop tops. but the foil cap keeps those voices to a minimum.

    Take a look at True Launch Bar.

    http://www.truelaunchbar.com/?utm_source=properties&utm_medium=about&utm_campaign=truelaunchbar

  2. The AutoIt command you need is ConsoleWrite. Here's a simple example.

    Variable Set String %T[1]% to ""Input Parameter""
    
    External Script: AutoIt
    
    Text Box Display:
    <VARIABLE SET STRING Option="\x00" Destination="%T[1]%" Value="\"Input Parameter\""/>
    
    <EXTERNAL SCRIPT Language="AutoIt" Dest="%T[2]%" Script="ConsoleWrite($CmdLine[1] & \" - suffix added by AutoIt!\")" Parameters="%T[1]%" Encoding="0"/>
    
    <TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang3081{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 Passed in:\r\n\\par    %T[1]%\r\n\\par \r\n\\par Returned:\r\n\\par    %T[2]%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="450" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
  3. is there a way to unlock workstation and run macro?

     

    Yes, but it's a little complicated!

    Here is a summary of the steps needed. If you're interested in the detail, please let me know.

     

    - Run a (I suggest password-protected to prevent others looking at the code) macro (scheduled to run at a specific time) to:

    - - place the machine in a state where it won't ask for a password when restarting (write values to the registry)

    - - reboot

    - Using a utility you can download for free, restart the machine and have MEP start a tailored startup macro to:

    - - reset the machine state to asking for a password

    - - run the macro you describe above to close and relaunch your app and enter a userid and password

     

    Your special startup macro can be run when the relevant registry value you wrote exists.

    -

  4. My solution would be to write a script that takes control of the MEP launch process and alloows it to be launched only if not already running. As an extreme example, I might rename MaxExp.exe to MEP.exe, then compile the Launcher script, written in Autoit, to an executable called Macexp.exe and locate it in the Macro Express folder.

    This would also take care of MEP being launched indirectly, i.e. by double-clicking on a playable macro.

  5. If you pass variable values when calling a macro, as in:

    C:\Program Files (x86)\Macro Express Pro\MeProc.exe /AMyMacro /VMyString:Now is the time

    then you must use the Restore [Text Variables] command in order for the variable MyString to become initialized with "Now is the time".

    What I do in such cases is to end the macro with a Clear Text variables command, followed by a Variable Save Text Variables command so that I don't subsequently inherit a value I no longer want.

    Apart from this, i cannot find a use for the Save and Restore commands in MEP.

  6. Cory,

     

    I've used the below code to check the mouse pointer. It moves the pointer to the progress bar area of the application and wait till the time the app gets the focused back from the server. Once it gets the focus back it execute the next set of code. The color code 14215660 is blue color.

    Mouse Move: 484, 729 Relative to Current Window
    Get Pixel Color from Beneath the Mouse into %N[1]%
    Repeat Until %N[1]% Equals "14215660"
      Mouse Move: 484, 729 Relative to Current Window
      Delay: 50 milliseconds
    End Repeat
    
    

    Any Suggestion ??

    Since you retrieve the pixel colour only once, your repeat statement will be executed either once only if the pixel colour is already blue, or for ever if it's not.. You need to include the Get Pixel Color command within the loop.

  7. Cory said

    You might want to consider using named variables in MEP instead of the old ME3 variable arrays.

     

    In fact your example is not using the old ME3 variable arrays, it is instead using named variables - but the names have absolutely no meaning!

    If you were using the old ME3 variable names, then, as an example, line 1 of your code would read

     

    Variable Set Integer %N[1]% to 0

    Instead, you have created a new integer variable called %N1%.

  8. OK, you could do as follows.

     

    Create macro M1, which contains a single line comprising an AutoIt function which:

    - creates a temporary hotkey (in this case Ctrl-Alt-X) which, when pressed, aborts the AutoIt function

    - continuously moves the mouse to a fixed point on your monitor (in this example it's 600, 512 which is the middle of my centre monitor)

    <EXTERNAL SCRIPT Language="AutoIt" Dest="%tOutput%" Script="HotKeySet(\"^!x\", \"MyExit\")\r\nWhile 1 <> 2\r\n    MouseMove(600, 512, 0)\r\nWEnd\r\n\r\nFunc MyExit()\r\n    Exit\r\nEndFunc" Encoding="0"/>

    Create macro M2 which calls M1 without waiting for it to complete, then gets on with its business (in this case, it simply displays a message advising the user to press Ctrl-Alt-X to unlock the mouse)

    <MACRO RUN Use_ID="FALSE" Name="M1" ID="-1" Wait="FALSE"/>
    <TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang3081{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 Press Ctrl-Alt-X to unlock the mouse.\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="2" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>

    If this approach works for you, then you could also pass as parameters to the AutoIt function the hotkey to use, and the location to move the mouse to. I can help you further with this if you're interested.

    Although you could write the mouse-moving code in MEP instead of AutoIt, in MEP you can't abort a specific macro, and you can't define a temporary hotkey.

  9. On my XP (SP3) PC I'm about to move 'My Documents' (in some folders quaintly but confusingly called 'Terry's Documents') from C:\Docs to I:\Docs.

    Consider using a symbolic link. This works by moving the object folder to, say, the D: drive (e.g. D:\My Documents), then telling the OS that C:\My Documents is actually located at D:\My Documents.

    In a modern and supported OS like Windows 7, you can use the command Mklink. For XP, I'm not sure if that's the case. See this URL for more information:

    http://superuser.com/questions/484061/how-to-create-an-ntfs-junction

  10. Here's how I'd do this. I'd write the grunt work in AutoIt as, IMHO, ME is ill-suited to this kind of processing. On my machine it runs in no more than 1 second, while using ME to do this takes many minutes at least (I gave up waiting after a minute).

    If you want to use this approach, you edit lines 1 and 2 to contain the name of your input and output files respectively.

    Variable Set String %tFileIn% to "D:\Temp\testin.txt"
    Variable Set String %tFileOut% to "D:\Temp\testout.txt"
    External Script: AutoIt

    ME Code

    <VARIABLE SET STRING Option="\x00" Destination="%tFileIn%" Value="D:\\Temp\\testin.txt" NoEmbeddedVars="FALSE"/>
    <VARIABLE SET STRING Option="\x00" Destination="%tFileOut%" Value="D:\\Temp\\testout.txt" NoEmbeddedVars="FALSE"/>
    <EXTERNAL SCRIPT Language="AutoIt" Dest="%tOutput%" Script="#include <Array.au3>\r\n#include <String.au3>\r\n\r\n$filein = FileOpen($CmdLine[1])\r\n$fileout = FileOpen($CmdLine[2], 2)\r\nWhile 1\r\n    $rec = FileReadLine($filein)\r\n    if @error = -1 Then ExitLoop\r\n    $arr = _StringExplode($rec, '')\r\n    $res = _ArrayToString($arr, ' ')\r\n    FileWriteLine($fileout, $rec & \"\\\" & $res & ' ')\r\nWEnd\r\n\r\nFileClose($filein)\r\nFileClose($fileout)" Parameters="%tFileIn% %tFileOut%" Encoding="0"/>

    AutoIt code (shown here for completeness, and contained within the ME code above)

    #include <Array.au3>
    #include <String.au3>
    
    $filein = FileOpen($CmdLine[1])
    $fileout = FileOpen($CmdLine[2], 2)
    While 1
        $rec = FileReadLine($filein)
        if @error = -1 Then ExitLoop
        $arr = _StringExplode($rec, '')
        $res = _ArrayToString($arr, ' ')
        FileWriteLine($fileout, $rec & "\" & $res & ' ')
    WEnd
    
    FileClose($filein)
    FileClose($fileout)
×
×
  • Create New...