• 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: Sierra 10.12.4 and JavaScript by AppleEvents in Safari
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sierra 10.12.4 and JavaScript by AppleEvents in Safari


  • Subject: Re: Sierra 10.12.4 and JavaScript by AppleEvents in Safari
  • From: Takaaki Naganoya <email@hidden>
  • Date: Thu, 30 Mar 2017 21:22:32 +0900

These scripts work well with my macOS 10.12.5beta+Safari 10.1.1.
I have houndreds of Safari script. But I can not check them all now.
In this case, you’d better to show the troubled script if you can. 

<AppleScript #1>
tell application "Safari"
tell document 1
--do _javascript_ "window.innerHeight"
set aRes to (do _javascript_ "String(document.body.clientHeight)")
do _javascript_ "window.scroll(0," & aRes & ")"
end tell
end tell
</AppleScrip #1t>

<AppleScript #2>
tell application "Safari"
-- the number of links in the front document 
set i to do _javascript_ "document.links.length" in document 1


set linkList to {}
repeat with j from 0 to i
-- getting the target URL of the first link of the front document 
set the end of linkList to do _javascript_ ("document.links[" & j as text) & "].text" in document 1
end repeat
linkList

end tell

</AppleScript #2>

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
  • Follow-Ups:
    • Re: Sierra 10.12.4 and JavaScript by AppleEvents in Safari
      • From: Christopher Stone <email@hidden>
References: 
 >Sierra 10.12.4 and JavaScript by AppleEvents in Safari (From: Christopher Stone <email@hidden>)
 >Re: Sierra 10.12.4 and JavaScript by AppleEvents in Safari (From: Takaaki Naganoya <email@hidden>)
 >Re: Sierra 10.12.4 and JavaScript by AppleEvents in Safari (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: Sierra 10.12.4 and JavaScript by AppleEvents in Safari
  • Next by Date: Re: Looking for Scripts, Snippets, Ideas for Toggling Windows and Tabs of an App
  • Previous by thread: Re: Sierra 10.12.4 and JavaScript by AppleEvents in Safari
  • Next by thread: Re: Sierra 10.12.4 and JavaScript by AppleEvents in Safari
  • Index(es):
    • Date
    • Thread