Request Username and Password when open macro

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury

Post Reply
foreversjc
Newbie
Posts: 1
Joined: Tue Dec 22, 2015 2:53 pm

Request Username and Password when open macro

Post by foreversjc » Tue Dec 22, 2015 3:05 pm

Is there a way to create a simple login form, so the user has to input his username and password, if it passes it opens the macro, if askes him to enter again.

The macro would post to an externa site, like www.test.com/macro.php and the response would be something like OK ( if user and password are ok, also if the user is not already logged in ) , ALREADY ( that means the user is already logged in, so he cant login again ) and WRONG ( username or password invalid ).

Then if everything is ok, the box closes and the macro goes on.

Thanks

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Request Username and Password when open macro

Post by Dorian (MJT support) » Mon Dec 28, 2015 11:34 pm

Note : This was already answered via support.
Yes, we have a Custom Scripting Service. Message me or go here

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

Re: Request Username and Password when open macro

Post by Marcus Tettmar » Wed Dec 30, 2015 10:05 am

Answered by support as Dorian says but for the benefit of others ..

You can set a password under Macro Properties in the Encryption tab. Or if you want a code based solution, perhaps for a compiled macro, a simple solution is just:

Code: Select all

Let>INPUT_PASSWORD=1
Input>strPassword,Enter your password:
If>strPassword<>MJTISCOOL
  Exit>0
Endif

//rest of macro here
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

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