Introduction: How to Make an Automatic Login for Gmail (Mac)

Picture of How to Make an Automatic Login for Gmail (Mac)

Hi guys!

Today I am going to teach ya'll to make an automatic Gmail login. You will be using Script editor. And this for Macintosh by the way. After you master this, you will be able to login for other things, 1Password, Minecraft, Yahoo etc...

Let's get started!!

Step 1: Script Editor

Picture of Script Editor

First open Script Editor. This is Apple's coding language. it is pretty much self-explanatory. Save it as whatever you like. I did Gmail Login.

Step 2: Code

Picture of Code

Type in the following,

tell application "Safari"
open location "https://accounts.google.com/ServiceLogin?service=mail&continue=https://mail.google.com/mail/#identifier"

end tell

Then press the little hammer. That is the first line of code. It tells Safari to open up the login page.

Step 3: More Code

Picture of More Code

Type in the following, (with no spaces)

tell application "System Events"
set texttosay to "Sample Text"

activate "Email login"

display dialog "Username" default answer "My Account"

set texttosay to the text returned of the result

activate application "Safari"

keystroke texttosay

delay 1

end tell

Now press the hammer

This will type in the username. Replace My Account with your Gmail Username.

Step 4: Even More Code

Picture of Even More Code

Type this in, then press the the hammer sign. This types in the password. Replace MyPassword with your Gmail

password.

tell application "System Events"
set texttosay to "Sample Text"

activate "Email login"

display dialog "Password" default answer "MyPassword" with hidden answer

set texttosay to the text returned of the result

activate application "Safari"

keystroke tab

delay 1

keystroke texttosay

delay 1

keystroke return

delay 5

activate "Email login"

end tell

Step 5: Video

This is a Video showing the code in action!

thank you!

Comments

About This Instructable

836views

0favorites

More by oripotam:How to Make an Automatic Login for Gmail (Mac)How to Make a Minecraft ServerPlay Minecraft On mac with xbox 360 controller
Add instructable to: