Skip to content

Instantly share code, notes, and snippets.

@geelen geelen/gist:73685

Created Mar 4, 2009
What would you like to do?
-- go.applescript
-- Created by Glen Maddern on 2009-03-03.
-- Copyright (c) 2009 __MyCompanyName__. All rights reserved.
on run
-- do something useful
tell application "Safari"
make new document with properties {URL:"file://localhost/Users/glen/work/boost-doc/main.html"}
delay 3
set docloaded to false
repeat 10 times
delay 1
set docstate to (do JavaScript "document.readyState" in document 1)
if docstate is "complete" then
set docloaded to true
exit repeat
end if
end repeat
if docloaded is true then
print document 1 without print dialog
end if
close document 1
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.