input variable only once into the compiled macro?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
joe88888
Newbie
Posts: 14
Joined: Wed Nov 22, 2006 4:56 pm

input variable only once into the compiled macro?

Post by joe88888 » Wed Apr 18, 2007 6:38 am

I created a script to auto log in the program. At the first few steps, I use input command to get variables of the username and password, etc. and then rest of the script will go to a loop. How to only ask the user input the username and password only once, and it will "hard-coded" the info into the compiled script, so the user do not need to input the info again when they run the compiled macro next time.
thanks for your kindly help!

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Apr 18, 2007 6:54 am

When you compile the script you can enter any vars into the "Include Parameters" section of the compiler dialog, e.g:

/username=user1 /password=secret
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Wed Apr 18, 2007 2:19 pm

I think this means have each user run the compiled macro, enter their username/pw only the first time and store it. Seems like a bad idea to me but if it doesn't violate any security procedures you could save the username/pw encrypted in an external file. Look at the help for Crypt>. Check for the existence of the password file when the macro starts. If it doesn't then run the pw input command or dialog, otherwise retrieve the info from the file and run the rest of the macro.

joe88888
Newbie
Posts: 14
Joined: Wed Nov 22, 2006 4:56 pm

Post by joe88888 » Wed Apr 18, 2007 3:49 pm

Thank you all,
Me_again, that is what I meant. Security is not a issue. but I do not know the user's user name and password in your suggetion.

mtettmar,
What exactly it does when I put these (/username=user1 /password=secret) into the parameter

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Wed Apr 18, 2007 6:43 pm

Hi joe88888,
joe88888 wrote:Me_again, that is what I meant. Security is not a issue. but I do not know the user's user name and password in your suggestion.
You do not need to know the user's name and password.

1) Your user runs the compiled macro
2) The macro checks for the existence of a certain file on their hard drive that contains their username and password (the first time the macro runs, the file will not be there)
3a) If it does not find that file, it should ask the user to enter their username and password and then write a file to their hard drive that contains that information
3b) If it does find the file, it can read the file to pull in the user name and password
4) Macro would continue normally after this

As Me_again suggests, you could use the Crypt> command to encrypt the username and password data before writing the file and to decrypt it when you need to read it.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Wed Apr 18, 2007 10:01 pm

Thanks, that's exactly what I had in mind but didn't have time to type this AM :)

joe88888
Newbie
Posts: 14
Joined: Wed Nov 22, 2006 4:56 pm

Post by joe88888 » Wed Apr 18, 2007 10:33 pm

That is very good idea. I will give it a try.
thank you.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts