Reload Safari tabs in the background via AppleScript
May 28, '09 07:30:00AM • Contributed by: NaOH-Lye
May 28, '09 07:30:00AM • Contributed by: NaOH-Lye
I frequently have multiple Safari tabs open. I'll be viewing a site, and one of the other tabs is a site I've already viewed, but will want to view again after some time has passed and it's been updated. It is possible to keep a tab in the background and reload it by right-clicking and selecting Reload Tab, but that seemed inefficient and like an interruption to whatever content I was currently viewing.
A quick trip into Applescript and I came up with this script to reload the first tab in the background:
A quick trip into Applescript and I came up with this script to reload the first tab in the background:
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
A few notes:
- This script requires a launcher (Script Menu, Butler, Keyboard Maestro, Spark, etc.) to allow execution via the keyboard.
- I made three of these scripts, one for each of the first three tabs in a window. The tab 1 in the script reflects the first (left-most) tab. Make as many versions as you'd like, just change the 1 as needed.
- Since Control-[number] is not used by Safari (like it is in Firefox), it's a reasonably good and easy-to-remember keyboard shortcut if your script-launching method allows for this.
•
[9,431 views]
