• 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: Safari Reload
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Safari Reload


  • Subject: Re: Safari Reload
  • From: Joe <email@hidden>
  • Date: Wed, 25 Jan 2012 21:00:11 -0800

On Jan 25, 2012, at 7:14 PM, Gil Dawson wrote:

Anyone know how to tell a Safari document to reload?

This works...

tell application "System Events" to tell process "Safari" to keystroke "r" using {command down}

...but it requires making the window frontmost and the tab visible.   In a particular application I'm writing for a client, it would be nice not to have to do that.

--Gil


Try this:

tell application "Safari"
do _javascript_ "_javascript_:location.reload(true)" in current tab of window 1
end tell
 _______________________________________________
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: Safari Reload
      • From: Gil Dawson <email@hidden>
References: 
 >Safari Reload (From: Gil Dawson <email@hidden>)

  • Prev by Date: Safari Reload
  • Next by Date: scripting the dictionary app
  • Previous by thread: Safari Reload
  • Next by thread: Re: Safari Reload
  • Index(es):
    • Date
    • Thread