Created
March 4, 2009 03:07
-
-
Save geelen/73685 to your computer and use it in GitHub Desktop.
This file contains 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
-- 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