requst url

hi,

I wanted to by pass login page of exchange account… instead of
login page, i will provide username and password values from
applescrip.

Can I do this using apple script…

Any pointer on this would be great help…
I’ll be looking for quick reply

thanks

regards.
Anni :slight_smile:

I assume this is for a web page login? There are probably some javascript commands to do this easily but I don’t know javascript. Here’s how I would do it…

First open the web page and hit the tab key on your keyboard until the cursor is placed in the user name box. Count the number of times you need to hit the tab key to get it there.

For example: 5 times

Next hit the tab key to place it in the password field and count the number of times you need to hit the tab key to get it there.

For example: 1 time

If you know those 2 things then the following applescript can do it for you, just adjust the top variables to your values…

-- put in your values here
set theURL to "http://whatever" --  the url of the web page
set theName to "login name" -- your login name
set thePass to "the password" -- the login password
set firstTabCount to 5 -- the number of tabs it takes to get to the login name field
set secondTabCount to 1 -- the number of tabs it takes from the name field to the password field
set webPageDelay to 5 -- the number of seconds to wait making sure that the web page is fully loaded, adjust as needed
set myDelay to 0.2 -- a generic delay between keystrokes, adjust as needed

-- open the web page
open location theURL
delay webPageDelay

tell application "Safari" to activate
tell application "System Events"
	tell process "Safari"
		-- tab to the name field
		repeat firstTabCount times
			keystroke tab
			delay myDelay
		end repeat
		
		-- enter the name
		keystroke theName
		delay myDelay
		
		-- tab to the password field
		repeat secondTabCount times
			keystroke tab
			delay myDelay
		end repeat
		
		-- enter the password
		keystroke thePass
		
		-- login
		delay myDelay
		keystroke return
	end tell
end tell

thanks hank,

but I wanted a solution which doesn’t show screen, means it would directly show the web page which appears after login.

regards,
Anni