How to Reload All Tabs in Safari

Hi,


I know there's a couple questions containing the exact same wondering but I have tried everything I have found with no luck. Perhaps because I am a newbie to running scripts but I really can't get across AppleScripts or JavaScripts. I've so far only found one script for Apple that seems to be legit and shows no error, but when I press "Run" nothing occurs. I am in a newbie dilemma. I simply want all opened tabs to reload on Safari with the touch of the button which I understand no longer exists by Safari itself.


I'll provide the working script below. Please help me out!


on run {input, parameters}



(* tell application "Safari"

set sameURL to URL of tab 1 of front window

set URL of tab 1 of front window to sameURL

end tell *)


return input

end run




And if you can, perhaps attach a screenshot haha! Thanks a ton!


Running the newest version of OS and Safari

Posted on Nov 27, 2015 6:45 AM

Reply
2 replies

Nov 27, 2015 10:34 AM in response to code2466

Hi,


The script do nothing because the script skip the text between (* and *), this text are comments.

You must remove (* and *), but the script reload the first tab only.



To reload all opened tabs, use this script:

tell application "Safari"

set tWindows to windows whose its current tab is not missing value -- get valid windows

repeat with tWind in tWindows

repeat with thisTab in (get tabs of tWind)

try

do JavaScript "window.location.reload();" in thisTab

end try

end repeat

end repeat

end tell



Or this:

tell application "Safari"

set tWindows to windows whose its current tab is not missing value -- get valid windows

repeat with tWind in tWindows

repeat with thisTab in (get tabs of tWind)

try

tell thisTab to set URL to (get URL)

end try

end repeat

end repeat

end tell

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to Reload All Tabs in Safari

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.