Color!

This might seem stupid, but the “choose color” option can be a password input!

set login_ to login()

on login()
	if (choose color) is {65535, 0, 0} then -- red
		if (choose color) is {0, 0, 0} then -- black 
			if (choose color) is {39321, 26214, 13107} then --brown
				if text returned of (display dialog "What is your name?" default answer "Your answer here." buttons {"OK"} default button 1) is "Dylan Weber" then
					if text returned of (display dialog "Password?" default answer "Your answer here." buttons {"OK"} default button 1 with hidden answer) is "password" then
						return true
					else
						return false
					end if
				else
					return false
				end if
			end if
		end if
	else
		return false
	end if
end login

Super-Safe :cool:

Wow, that’s pretty cool :slight_smile: can you get it to read a password from a text file? I’ve had a go myself but it doesn’t work…

Nice idea. :slight_smile:

You can economise on the logic a bit like this:

set login_ to login()

on login()
	return (choose color) is {65535, 0, 0} and ¬
		(choose color) is {0, 0, 0} and ¬
		(choose color) is {39321, 26214, 13107} and ¬
		text returned of (display dialog "What is your name?" default answer "Your answer here." buttons {"OK"} default button 1) is "Dylan Weber" and ¬
		text returned of (display dialog "Password?" default answer "Your answer here." buttons {"OK"} default button 1 with hidden answer) is "password"
end login

How do I get it to read a password from a file?

Search this site. There is soooo much information on read/write to file. Also look in the Unscripted section. Lots of very useful tutorials there as well.

Once you have done that, make a new post in the AppleScript forum if you still have questions about it.

Regards,

Craig