paul
-
Posts
1,049 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by paul
-
-
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"/>
-
I've found the code to activate a particular window through VBA......
I'll appriciate if someonce can help me converting this script to work as VB script.
I'm sure you would! Converting a VB6 call to a dll into Vbscript is by no means a trivial operation. I'd be very surprised if you could persuade someone to do this for you gratis.
-
You're upside down! Instead of removing everything but commas and counting what's left, simply replace the commas with nothing and count the difference in length between the original and new strings!
-
How do I get it to be a "special start up macro" as you suggested?
Thanks again for you help with this!
Schedule it to run when MEP starts - and you'll need to be able to distinguish between normal mode, and the special mode created by your auto log on tool, so that you run your desired macro only in this special mode.
-
Thanks guys for responses.
Just to let you know I purchased an auto login tool that logs me in just before the macro is scheduled to run. But no luck. Any suggestions?
Cheers
I did outline a solution above - it's up to you to request details if you're interested.
-
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.
-
-
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.
-
Thanks for following up on this Kevin. I'm constantly plagued by this same problem especially doing batch emails for my clients. IMHO spam filters are the 'cure' that's worse than the disease.
Without using (or being able to use) any spam filters in Gmail, I find its ability to detect Spam almost faultless.
-
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.
-
I have always thought that the innate sort sequence is dictated by the file system, irrespective of OS. So NTFS returns files in name sequence, while FAT[32] returns them in no useful sequence.
-
Perhaps we'll have to mandate a drugs test before we can accept users' responses!
-
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.
-
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%.
-
Moving the mouse is a great idea. Couldn't you just do that with MEP?
Didn't I answer that point already in this sentence?
"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."
-
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.
-
What's wrong with using the clipboard, which you can read in MEP?
-
The location of the program you'll need is C:\Windows\System[32]\wscript.exe
-
Did you try Alt-e?
-
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
-
Paul,
I tried to run the .vbs file from CMD. Does it simply opens the .vbs file from the particular location or does it runs the file. In my case it just opened the file.
Presumably you mean the file opened in Notepad? If so, you'll need to change the .vbs extension's association in the registry, so that it runs instead of "opening".
-
Also i'm not aware of how to use then .vbs file in a command prompt.
Open a command prompt window, and type the name of your script, uncluding the pathname if required, AND the extension, e.g.
d:\mypath\myscript.vbs
-
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)
-
And a fellow Canadian to boot.
Ah, that would explain the quality of writing (as opposed to being written by an American! )
-
I described these kinds of scripting techniques in an article I wrote several years ago:
http://www.cantoraccess.com/publications/macros_2007_csun_smartmacros.shtml
What a great article! And very well-written too.
Cory's Macro Page
in Macro Express 3.x Third Party Tools
Posted
Take a look at True Launch Bar.
http://www.truelaunchbar.com/?utm_source=properties&utm_medium=about&utm_campaign=truelaunchbar