First off I am the suck at scripting/programming. The script below is the product of a lot of help from a coworker.
The script runs when tested on my desktop but I get Error number 10004 when I run it on a headless machine. Basically I want to run this script on a headless machine whose only purpose is the script.
Any insight would be great. I would like to get this running before Jan 1 so all of 2012 is captured. This is not for school but a side film project for myself.
Thanks!!!
---------the script--------
set f to choose folder with prompt "Screenshots will be saved here"
set f to POSIX path of f
set f to quoted form of f
tell application "Safari"
repeat with c from 1 to 600000
activate
set URL of front document to "http://www.google.com/"
do shell script "screencapture " & f & "screenshot" & c & ".png"
delay 60
end repeat
end tell
---------end of script------
------------------------log begin-----------------------------
tell application "AppleScript Editor"
choose folder with prompt "Screenshots will be saved here"
--> alias "Macintosh H
Users:media
ictures:Westham Gauge:"
end tell
tell application "Safari"
activate
set URL of document 1 to "http://water.weather.gov/ahps2/hydrograph.php?wfo=akq&gage=rmdv2&view=1,1,1,1,1,1,1,0"
do shell script "screencapture '/Users/media/Pictures/Westham Gauge/'screenshot1.png"
--> error number -10004
end tell
tell current application
do shell script "screencapture '/Users/media/Pictures/Westham Gauge/'screenshot1.png"
--> ""
end tell
tell application "Safari"
activate
set URL of document 1 to "http://water.weather.gov/ahps2/hydrograph.php?wfo=akq&gage=rmdv2&view=1,1,1,1,1,1,1,0"
do shell script "screencapture '/Users/media/Pictures/Westham Gauge/'screenshot2.png"
--> error number -10004
end tell
tell current application
do shell script "screencapture '/Users/media/Pictures/Westham Gauge/'screenshot2.png"
--> ""
end tell
tell application "Safari"
activate
set URL of document 1 to "http://water.weather.gov/ahps2/hydrograph.php?wfo=akq&gage=rmdv2&view=1,1,1,1,1,1,1,0"
do shell script "screencapture '/Users/media/Pictures/Westham Gauge/'screenshot3.png"
--> error number -10004
end tell
tell current application
do shell script "screencapture '/Users/media/Pictures/Westham Gauge/'screenshot3.png"
--> ""
end tell
tell application "Safari"
activate
set URL of document 1 to "http://water.weather.gov/ahps2/hydrograph.php?wfo=akq&gage=rmdv2&view=1,1,1,1,1,1,1,0"
do shell script "screencapture '/Users/media/Pictures/Westham Gauge/'screenshot4.png"
--> error number -10004
end tell
tell current application
do shell script "screencapture '/Users/media/Pictures/Westham Gauge/'screenshot4.png"
--> ""
-------------------log end-----------------------------------------------------
The script runs when tested on my desktop but I get Error number 10004 when I run it on a headless machine. Basically I want to run this script on a headless machine whose only purpose is the script.
Any insight would be great. I would like to get this running before Jan 1 so all of 2012 is captured. This is not for school but a side film project for myself.
Thanks!!!
---------the script--------
set f to choose folder with prompt "Screenshots will be saved here"
set f to POSIX path of f
set f to quoted form of f
tell application "Safari"
repeat with c from 1 to 600000
activate
set URL of front document to "http://www.google.com/"
do shell script "screencapture " & f & "screenshot" & c & ".png"
delay 60
end repeat
end tell
---------end of script------
------------------------log begin-----------------------------
tell application "AppleScript Editor"
choose folder with prompt "Screenshots will be saved here"
--> alias "Macintosh H
Users:mediaend tell
tell application "Safari"
activate
set URL of document 1 to "http://water.weather.gov/ahps2/hydrograph.php?wfo=akq&gage=rmdv2&view=1,1,1,1,1,1,1,0"
do shell script "screencapture '/Users/media/Pictures/Westham Gauge/'screenshot1.png"
--> error number -10004
end tell
tell current application
do shell script "screencapture '/Users/media/Pictures/Westham Gauge/'screenshot1.png"
--> ""
end tell
tell application "Safari"
activate
set URL of document 1 to "http://water.weather.gov/ahps2/hydrograph.php?wfo=akq&gage=rmdv2&view=1,1,1,1,1,1,1,0"
do shell script "screencapture '/Users/media/Pictures/Westham Gauge/'screenshot2.png"
--> error number -10004
end tell
tell current application
do shell script "screencapture '/Users/media/Pictures/Westham Gauge/'screenshot2.png"
--> ""
end tell
tell application "Safari"
activate
set URL of document 1 to "http://water.weather.gov/ahps2/hydrograph.php?wfo=akq&gage=rmdv2&view=1,1,1,1,1,1,1,0"
do shell script "screencapture '/Users/media/Pictures/Westham Gauge/'screenshot3.png"
--> error number -10004
end tell
tell current application
do shell script "screencapture '/Users/media/Pictures/Westham Gauge/'screenshot3.png"
--> ""
end tell
tell application "Safari"
activate
set URL of document 1 to "http://water.weather.gov/ahps2/hydrograph.php?wfo=akq&gage=rmdv2&view=1,1,1,1,1,1,1,0"
do shell script "screencapture '/Users/media/Pictures/Westham Gauge/'screenshot4.png"
--> error number -10004
end tell
tell current application
do shell script "screencapture '/Users/media/Pictures/Westham Gauge/'screenshot4.png"
--> ""
-------------------log end-----------------------------------------------------