Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'This will be more efficient...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
This will be more efficient...
Authored by: cougar718 on Jan 15, '03 05:59:00PM

The below script is a slight modification to the original. This uses the application's idle handler instead of keeping the application in a repeat loop. The "Delay" call tends to use more of the CPU than the idle handler. To use this version, save the script as an application with the "stay open" option checked. The property "shot_interval" can be set to any number, default is 3600 seconds which is 1 hour. This version also rules out the editor's warning about too small of an interval. Good luck and any questions, email me cougar718@comcast.net. Thanks.

property save_location : ""
property shot_count : 1
property shot_interval : 3600 -- in seconds

on run {}
set save_location to ¬
(choose folder with prompt "Choose where to save screenshots")
set shot_count to 1
end run

on idle
do shell script "screencapture " & ¬
quoted form of POSIX path of save_location ¬
& "screen" & (shot_count as string) & ".pdf"
set shot_count to shot_count + 1
return shot_interval
end idle



[ Reply to This | # ]
This will be more efficient...
Authored by: diZZy on Jan 16, '03 11:24:29AM

And how about changing the " "screen" & (shot_count as string) " bit to something a bit more usefull (for some!) like the current date and time?
And maybe a 10 seconds delay before the first capture!!!



[ Reply to This | # ]
This will be more efficient...
Authored by: cougar718 on Jan 16, '03 02:22:53PM

Ok, I was not trying to completely modify the original, but your wish is my command bro. This modified script features a 10 second delay before the first capture and names the Screenshot

ScreenCap - Thursday, January 16, 2003 14/21/45.pdf

Note: Because of the way the shell handles semi-colons, the time is formatted with / instead of :

Use this new script in place of the old one. Have fun and good luck!

property first_run : true
property save_location : ""
property shot_interval : 3600 -- in seconds

on run {}
set first_run to true
set save_location to ¬
(choose folder with prompt "Choose where to save screenshots")
end run

on idle
if (first_run) then
set first_run to false
return 10 -- 10 second delay before first picture
else
do shell script "screencapture " & ¬
quoted form of (POSIX path of save_location ¬
& "ScreenCap - " & ((current date) as string) & ".pdf")
return shot_interval
end if
end idle



[ Reply to This | # ]
This will be more efficient... Brilliant is the word!
Authored by: diZZy on Jan 16, '03 03:05:24PM

Ta very much mate!
I did toy a bit with your original script but I couldn't quite work it out properly... I was using >>> ((the current date) as string) <<<
Thanks a bunch



[ Reply to This | # ]
This will be more efficient... Brilliant is the word!
Authored by: cougar718 on Jan 16, '03 10:56:52PM

You are welcome bro. Laterz

Rick



[ Reply to This | # ]