• 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: Smile - Working Load Web Window with Log-In
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Smile - Working Load Web Window with Log-In


  • Subject: Re: Smile - Working Load Web Window with Log-In
  • From: Christopher Stone <email@hidden>
  • Date: Thu, 03 Dec 2015 01:24:31 -0600

On Dec 03, 2015, at 00:35, Christopher Stone <email@hidden> wrote:
I've finally got a working example.
______________________________________________________________________

Hey Folks,

Here's the comparable code for Safari.

Again the username and password are dummies, and the submit code is commented-out.

--
Best Regards,
Chris

-------------------------------------------------------------------------------------------

set siteURL to "https://www.mycardioforlife.com/customer-login"

set siteUserName to "the-user-name"
set sitePassword to "the-password"

set jsStr to "
document.forms['loginform']['Username'].value = '" & siteUserName & "';
document.forms['loginform']['password'].value = '" & sitePassword & "';
// document.getElementById('#btnSubmit').click();
"
tell application "Safari"
  activate
  make new document with properties {URL:siteURL}
  set bounds of front window to {228, 23, 1542, 1196}
  if SAFARI_PAGE_LOADED(20) of me then
    tell front document to do _javascript_ jsStr
  else
    error "Problem loading page in Safari!"
  end if
end tell

-------------------------------------------------------------------------------------------
--» HANDLERS
-------------------------------------------------------------------------------------------
on SAFARI_PAGE_LOADED(timeout_value)
  delay 2
  repeat with i from 1 to the timeout_value
    tell application "Safari"
      if (do _javascript_ "document.readyState" in document 1) is "complete" then
        return true
      else if i is the timeout_value then
        return false
      else
        delay 2
      end if
    end tell
  end repeat
  return false
end SAFARI_PAGE_LOADED
-------------------------------------------------------------------------------------------

 _______________________________________________
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: 
 >Smile - Working Load Web Window with Log-In (From: Christopher Stone <email@hidden>)

  • Prev by Date: Smile - Working Load Web Window with Log-In
  • Next by Date: Re: silly errors
  • Previous by thread: Smile - Working Load Web Window with Log-In
  • Next by thread: Safari – Duplicate Tab Next to Itself
  • Index(es):
    • Date
    • Thread