encrypted chained macro fails to run
Moderators: JRL, Dorian (MJT support)
encrypted chained macro fails to run
I have a multi purpose macro invoked by F9 hotkey. Depending on the application underneath it performs different functions. One of them is intended to send a password through to Quicken. It does this by calling a further encrypted macro which contains the password. I've written and tested it all. It works fine. Finally, I applied encryption to the password macro. Now it doesn't work. So, I put in messages to see what's going on because you can't debug a hotkeyed macro. I've pasted the appropriate parts from the F9 macro below. I thought it might be pathing so I tried both pathing methods (one is remmed). Finally, when "QuickenZipUp.scp" is UNencrypted the debug message displays correctly ie., "Macro result = [ok]". When "QuickenZipUp.scp" is ENcrypted the debug message displays "Macro result = [%MACRO_RESULT%]" which tends to indicate that the macro was never reached. (It goes without saying that the 1st thing the password macro does is set the MACRO_RESULT value).
Here's the code portion;
Label>DoQuicken
//Macro>%SCRIPT_DIR%\QuickenZipUp.scp /arg1=Quicken
Macro>C:\Documents and Settings\user\My Documents\Macro Scheduler\QuickenZipUp.scp /arg1=Quicken
MessageModal>Macro result = [%MACRO_RESULT%]
Goto>Exit
Here's the code portion;
Label>DoQuicken
//Macro>%SCRIPT_DIR%\QuickenZipUp.scp /arg1=Quicken
Macro>C:\Documents and Settings\user\My Documents\Macro Scheduler\QuickenZipUp.scp /arg1=Quicken
MessageModal>Macro result = [%MACRO_RESULT%]
Goto>Exit
Encrypted macros require the password to open the program, well before the MACRO_RESULT is populated.
Would it be possible for you to encrypt the calling macro (the 'F9' macro) and place the password macro within a Subroutine (srt>) which is only called when needed?
For sensitive data it may be a better solution to put several SRT>'s in a single file and call them when necessary instead of calling multiple macros.
Would it be possible for you to encrypt the calling macro (the 'F9' macro) and place the password macro within a Subroutine (srt>) which is only called when needed?
For sensitive data it may be a better solution to put several SRT>'s in a single file and call them when necessary instead of calling multiple macros.
Well, unless I have misread you, what you've said directly contradicts the help file info. - "Macro Scheduler allows you to set a password for a script which must then be used to edit it."
Edit it - not run it.
"However, if you need to use Macro Scheduler to automate a process which involves sending passwords to other applications or to send other sensitive information, then you would want to ensure that only the right people can edit the script and see the secrets."
I understand the encryption is intended to be used to protect the source code. Requiring a password for execution is a separate option which I have NOT selected.
The help is quite specific about this.
The password macro IS the one containing sensitive data, that's why I wish to encrypt it. The calling macro is general purpose and does not require encryption.
Edit it - not run it.
"However, if you need to use Macro Scheduler to automate a process which involves sending passwords to other applications or to send other sensitive information, then you would want to ensure that only the right people can edit the script and see the secrets."
I understand the encryption is intended to be used to protect the source code. Requiring a password for execution is a separate option which I have NOT selected.
The help is quite specific about this.
The password macro IS the one containing sensitive data, that's why I wish to encrypt it. The calling macro is general purpose and does not require encryption.
The "Marcus workaround" #1 does not work. The UNencrypted macro when invoked via "Run" works correctly. When it is ENcrypted, I see a flying Macro Scheduler icon dashing across the screen, but the macro does not execute. A "here I am" message within the macro fails to display.
Run Program>C:\Program Files\Macro Scheduler\msched.exe C:\Documents and Settings\user\My Documents\Macro Scheduler\QuickenZipUp.scp /arg1=Quicken
Run Program>C:\Program Files\Macro Scheduler\msched.exe C:\Documents and Settings\user\My Documents\Macro Scheduler\QuickenZipUp.scp /arg1=Quicken
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Instead of hard coding and/or encrypting the password in the script, how about reading it in from a hidden, security permissions controlled text file?
In any method that you decide to use, if using SEND>, remember that log files will display the values, so you may want to disable logging, or pass the log file through an editor to Search/Replace the SEND> line with the password. The last line in your macro could call another macro to do the editing of the log file once it was closed.
In any method that you decide to use, if using SEND>, remember that log files will display the values, so you may want to disable logging, or pass the log file through an editor to Search/Replace the SEND> line with the password. The last line in your macro could call another macro to do the editing of the log file once it was closed.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
"Marcus workaround" #2 - assigning a hot key to the encrypted macro and "pressing" the hotkey in the calling macro DOES work.
Bob, reading a password from a hidden file using a plain text (unencrypted) macro would defeat the purpose of having a secret file. If the method is plain to see then so is the password.
Re, logging. If the macro is encrypted without logging, then logging cannot be subsequently turned on without first supplying the encryption password, so this is not an issue for me.
For me the purpose of this is to be able to have the encrypted password supplied to the application using a few keystrokes - to save having to tediously type the password as I have been doing for the last 9 years. I have built in a failsafe so no one can easily poke away at it. Now it's all working I am quite happy with it.
I use an incrementing environment variable. This variable seems to be visible only to Macro Scheduler. If I drop to Dos and check, it's not there!
Bob, reading a password from a hidden file using a plain text (unencrypted) macro would defeat the purpose of having a secret file. If the method is plain to see then so is the password.
Re, logging. If the macro is encrypted without logging, then logging cannot be subsequently turned on without first supplying the encryption password, so this is not an issue for me.
For me the purpose of this is to be able to have the encrypted password supplied to the application using a few keystrokes - to save having to tediously type the password as I have been doing for the last 9 years. I have built in a failsafe so no one can easily poke away at it. Now it's all working I am quite happy with it.
I use an incrementing environment variable. This variable seems to be visible only to Macro Scheduler. If I drop to Dos and check, it's not there!