Hey everyone, I'm new to this forum, and have been working on an apple script that simply opens a couple URLs to document 1 of safari. Well right now I am using delay, to ensure that all these pages fully load before jumping to the next, but this changes depending on how fast my internet connection is, and it would be much more convenient to have some way of saying for example:
if document 1 has fully loaded then
set URL of document 1 to "http://example.com"
end if
but i have no idea of how to do this. I have tried getting the source as a way of telling if the page has fully loaded but can not get it to work with an if statement. so... any ideas?
here's the script:
if document 1 has fully loaded then
set URL of document 1 to "http://example.com"
end if
but i have no idea of how to do this. I have tried getting the source as a way of telling if the page has fully loaded but can not get it to work with an if statement. so... any ideas?
here's the script:
Code:
tell application "Safari"
activate
repeat
set URL of document 1 to "http://example.com"
delay 4
set URL of document 1 to "http://example2.com"
delay 4
set URL of document 1 to "http://example3.com"
delay 4
set URL of document 1 to "hhttp://example4.com"
delay 4
set URL of document 1 to "http://example5.com"
delay 4
set URL of document 1 to "http://example6.com"
delay 5
tell application "Safari"
activate
tell application "System Events" to key code 48
tell application "System Events" to key code 36
delay 5
end tell
end repeat
end tell