property url_list : {"", "", "", "", ""}
property _defaultTotalRefreshes : 0
property _defaultTotalSeconds : 1
set _numoftabs to (choose from list {"1", "2", "3", "4", "5"} with prompt "How many tabs will you have open for auto Refreshing?" default items "1" OK button name "This Many" cancel button name "Nevermind")
--These two variables are very self explanatory
set _total to the text returned of (display dialog "How many total refreshes?" default answer ¬
_defaultTotalRefreshes with title "Total")
set _seconds to the text returned of (display dialog "How many seconds per refresh?" default answer ¬
_defaultTotalSeconds with title "Seconds")
--Set the default seconds to the previously entered number so it will be remembered
--for the next time the user runs the script
set _defaultTotalSeconds to _seconds
set _defaultTotalRefreshes to _total
if _numoftabs = false then --Determine if the user wants to quit
error "User canceled." number -128
else
repeat with i from 1 to _numoftabs --Fill the list with urls
set item i of url_list to text returned of (display dialog "What website do you want to set for tab " & i & "?" default answer "http://" with title "Enter the WHOLE address (http:// too)")
end repeat
tell application "Safari"
make new document
set winID to the id of window 1 --crucial for not crossing over to other window
repeat with j from 1 to _numoftabs --open that list in new tabs
set URL of tab j of window id winID to item j of url_list
if j is less than _numoftabs then --opens the amount of tabs specified
make new tab of window id winID
end if
end repeat
-- HERE IS THE AUTO REFRESH PART
repeat with _count from 0 to _total
repeat with k from 1 to _numoftabs
set URL of tab k of window id winID to item k of url_list
delay _seconds
end repeat
end repeat
end tell
end if