Skip to content

Instantly share code, notes, and snippets.

@geelen
Created March 4, 2009 03:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geelen/73685 to your computer and use it in GitHub Desktop.
Save geelen/73685 to your computer and use it in GitHub Desktop.
-- 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