groups

name language licence
UniqueID AppleScript GPL 2
LaunchTaskApps AppleScript Other
LittleSnapper_snapWeblet AppleScript Other
Split First Name - Address Book AppleScript Other
LittleSnapper_snapWeb AppleScript Other
check_safari_page_loaded_handler_js AppleScript Other
Delete Nameless Entries - Address Book AppleScript Other
Cleanup @ Entries - Address Book AppleScript Other

< 1 2 3 >



language: AppleScript
licence: Other

check_safari_page_loaded_handler_js

options: view full snippetsend to code collector
tell application "Safari"
	set the URL of the front document to "http://some.web.page"
	delay 2 --the page begins loading
	repeat with i from 1 to 20--check 20 times
		if (do JavaScript "document.readyState" in document 1 is "complete" then
			exit repeat--the page has successfully loaded
		else
			delay 1
		end if
	end repeat--go back and check again after the one second delay
end tell
	
(Continues...)