print screenshot with applescript
-- this script take one screenshot, save it, opens the application preview and prints the screenshot
set save_locationA to "pieria HD:nelson:collectImage:" -- replace the text in the " " with you file path
set myTime to (do shell script "date '+%d%H%M%S'") -- creates a specific timestamp
do shell script "screencapture " & quoted form of POSIX path of save_locationA & "image" & myTime & ".JPEG"
-- takes the screenshot and saves it
tell application "Preview"
open save_locationA & "image" & myTime & ".JPEG"
end tell
activate application "Preview"
PrintPreview()
delay (4)
tell application "Preview" to quit
delay (3)
quit
on PrintPreview()
tell application "System Events"
tell process "Preview"
delay 2
keystroke "p" using {command down}
delay 1
keystroke return
delay 1
end tell
end tell
end PrintPreview
set save_locationA to "pieria HD:nelson:collectImage:" -- replace the text in the " " with you file path
set myTime to (do shell script "date '+%d%H%M%S'") -- creates a specific timestamp
do shell script "screencapture " & quoted form of POSIX path of save_locationA & "image" & myTime & ".JPEG"
-- takes the screenshot and saves it
tell application "Preview"
open save_locationA & "image" & myTime & ".JPEG"
end tell
activate application "Preview"
PrintPreview()
delay (4)
tell application "Preview" to quit
delay (3)
quit
on PrintPreview()
tell application "System Events"
tell process "Preview"
delay 2
keystroke "p" using {command down}
delay 1
keystroke return
delay 1
end tell
end tell
end PrintPreview
0 Comments:
Post a Comment
<< Home