• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Script for Auto-login to websites
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script for Auto-login to websites


  • Subject: Re: Script for Auto-login to websites
  • From: deivy petrescu <email@hidden>
  • Date: Thu, 5 Jun 2008 08:20:33 -0400


On Jun 5, 2008, at 5:26, SVV Satyanarayana wrote:

I have considered the things that you mentioned in previous mails. Thanks for that.
How is it possible to click a particular link in a webpage? Or How to get the weblinks in a page and filter them, so that I can click it from the script and open that page.
Using Applescript and System Events, I am able to generate key strokes and click for the objects (like buttons etc). But I am not able to click a weblink in a web page.

Yes you are... if you are using Safari.
Check the "advanced" pane in Safari and click in the "Press tab to highlight..." check button.
Now just click on tab and the focus goes to buttons, fields and links.




I am able to do it from automator, but I am looking for the same in AppleScript.

SVV Satyanarayana
Bangalore, India
P Please consider the environment
before printing this email.

On 04-Jun-08, at 10:09 PM, Ed Stockly wrote:


>>Alan>>
This works for me.

tell application "Safari"
 activate
 open location "http://mail.yahoo.com";
 delay 5
 tell application "System Events" to keystroke "username" & tab &
"password" & return
end tell
This is a good answer Alan!

The delay may need to be adjusted depending on the loading speed of the site you go to.

In some cases you can wait until the name of the window has changed set before proceeding.


repeat until the name of window 1 is "foo"
delay 1
end

True . . .but the script also will need adjusting to allow if the particular web site being logged into doesn't automatically select the username field. Some do. . . some don't.

That should be fairly easy to script, in most cases web sites are fairly consistent. Once the page is open you may need to script a couple tabs to get to your desired field.



There's also a security issue with having passwords in a script . . .

I use a property, which has to be set the first time it's run, then remembers it from subsequent run and is invisible to prying eyes.
property myPass :""


if myPass = "" then
--insert routine getting password from user

HTH,

ES




Deivy _______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Script for Auto-login to websites (From: SVV Satyanarayana <email@hidden>)
 >Re: Script for Auto-login to websites (From: Alan Fairlie <email@hidden>)
 >Re: Script for Auto-login to websites (From: Neil Laubenthal <email@hidden>)
 >Re: Script for Auto-login to websites (From: Ed Stockly <email@hidden>)
 >Re: Script for Auto-login to websites (From: SVV Satyanarayana <email@hidden>)

  • Prev by Date: Re: AppleScript sets busy cursor even when displaying alert
  • Next by Date: Re: AppleScript sets busy cursor even when displaying alert
  • Previous by thread: Re: Script for Auto-login to websites
  • Next by thread: Re: Script for Auto-login to websites
  • Index(es):
    • Date
    • Thread