I have Macro Scheduler versions 11.1.23 and 12.1.10 both installed on my work PC.
Issue 1: possible bug
The following code works fine run from version 11:
Code: Select all
//Put HashLib.dll in the script directory
Let>HashLib=%SCRIPT_DIR%\HashLib.dll
MDL>HashLib
//Get MD5 hash of a file
LibFunc>HashLib,FileMD5,r1,C:\WINDOWS\system32\msscript.ocx,buf1
MessageModal>r1
Mid>r1_2,1,r1,hash1
MDL>hash1
From version 11, the value of variable HashLib is:
C:\Documents and Settings\jpuzian1\My Documents\Macro Scheduler 11\HashLib.dll
From version 12, the value of variable HashLib is:
C:\Documents and Settings\jpuzian1\My Documents\Macro Scheduler 12\HashLib.dll
I have a copy of the file HashLib.dll in both places... so why does this work in version 11 but not 12?
Issue 2: documentation error
In the file HashLib.zip which I downloaded from your website, you have a file there called HashLib.txt that explains the use of HashLib.dll however in that file, you have this:
That Mid> line won't work... I believe you meant this instead:HashLib.txt wrote://Get MD5 hash of a file
LibFunc>Hashlib,FileMD5,r,c:\somefile.exe,buf
Mid>r2,1,r,hash
MessageModal>Hash: %hash%
Mid>r_2,1,r,hash
All the usage examples in HashLib.txt have the same error.
To those reading this and wondering why the Mid> line is there, I believe it is there to trim the hash value to the number of characters it has returned as the length of the return value in the resultvar "r".
Issue 3: syntax highlighting problems
In version 12, I see this in the MS editor:
MidStr>r_2,1,r,hash
- Why is the 1 dark blue... shouldn't it just be black?
When I use Mid (the abbriviated form of the command), I see this:
Mid>r1_2,1,r,hash
- Abbrieviated commands should also be colored green... I was expecting this:
Mid>r1_2,1,r,hash
Issue 4: Just a question actually...
I'd like to generate an MD5 hash on a file from within a compiled script. I can't really "Put HashLib.dll in the script directory" because there is no "script directory" as I am running a compiled script on a PC that does not have Macro Scheduler installed. Can I just:
- use "Import Binary File" and carry the HashLib.dll file within the script as a payload
- when my compiled macro runs, it will extract the file to an accessible place on the user's machine like %TEMP_DIR%
- in the LibFunc> line, I can point at where I put the file...
I tried this with version 11 but received the error message "Unable to Locate Script Compiler". That's fine, I really want to use version 12 anyway. Once I get past Issue 1... will this approach work?
Thanks Marcus...