Last active
July 3, 2018 13:15
-
-
Save jimfdavies/41b7c973f961bc41a06b9fb58b8bd06a to your computer and use it in GitHub Desktop.
Safari Tab Cycler Applescript for dashboards, etc on Macs. Needs open Safari window(s) and presents startup options.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Safari" | |
set reloadQuestion to display dialog "Reload each tab?" buttons {"Yes", "No"} default button 2 | |
set reloadAnswer to button returned of reloadQuestion | |
if reloadAnswer is equal to "Yes" then | |
set reloadTab to true | |
else | |
set reloadTab to false | |
end if | |
(choose from list {1, 5, 10, 30, 60} ¬ | |
with prompt "Select delay time in seconds?" default items 30) | |
set delaySecs to result as text | |
repeat | |
repeat with i from 1 to (count of tabs of window 1) by 1 | |
set thisTab to tab i of window 1 | |
set current tab of window 1 to thisTab | |
if reloadTab then | |
set docUrl to URL of document 1 | |
set URL of document 1 to docUrl | |
end if | |
delay delaySecs | |
end repeat | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment