From: Milton Aupperle <milton@outcastsoft.com>

Date: March 17, 2012 12:51:33 PM MDT

To: Astro_IIDC@yahoogroups.com

Subject: Re: [Astro_IIDC] timer feature ?


Hi Ron;


On 17-Mar-12, at 10:23 AM, cosmicrock2001 wrote:


Hi Milton,  thanks for your continued updates and improvements to AstroIIDC.  With the solar action picking up, eclipse and transit of Venus coming soon,  I find myself wanting a way to shoot off video, avg. or single frames at a regular interval.  Is this something you'd consider incorporating or is it too difficult?   It would make time lapse images of the eclipse and transit especially easy to do, but also fast changing proms, other things on the sun or moons of Jupiter for example.


Your best bet is Apple Script (see "Other" folder in the DMG installer) , which allows you to grab a frame, frames or series of movies at user defined time intervals and over a specified time too. I've used them in the past for Jupiter moon rotations and lunar eclipse too.


The best script to look at for movies is the "RecordMultipleMovies Script"  (it records multiple movies at specified time) and for Frame grabs use the "RecordMultipleFrames Script" (it grabs a single frame at specified times).


For the "RecordMultipleMovies Script" there are 3 values you want to play with, the "grabforduration", the "increment" and the "recordtime".


The "grabforduration" value (set to 1800 in the script), determines how many seconds the script will run for. If you have a 3 hour event, then this value will need to 3x60x60 or 10800 seconds.


The "increment" value (set to 60 in the script), determines how seconds between each movie capture. So if you want to capture a movie at 5 minute intervals, then you would use a value of 300 seconds.


The "recordtime" value (set to 30 in the script), determines how many seconds the movie will be recorded for .If you set it to 45, then it will record video for 45 seconds.


For the "RecordMultipleFrames Script" (it grabs a single frame at user defined intervals)  there are 2 values you want to play with, the "grabforduration" and the "increment".


The "grabforduration" value (set to 60 in the script), determines how many seconds the script will run for. If you have a 1 hour event, then this value will need to 60x60 or 3600 seconds.


The "increment" value (set to 5 in the script), determines how often to grab a frame at. If it was set to 10, it would grab a frame every 10 seconds.


And here is a modified version of the Grab a frame script  that I just whipped up of the "RecordMultipleFrames Script" that will record a user defined number of frames each time. The only difference is it has an additional value named "numberOfFrames" which will specifies the number of frames that are grabbed each time it runs.


------------------ START OF SCRIPT

--The script will run for 60 seconds and grab a 10 frame burst every 5 seconds

--Change the inputs parameters below to adjust it for your own needs


-- Apple scripts will normally time out out after 60 seconds has elapsed, with timeout sets this to 10 minuteswith timeout of 600 seconds -- wait up to 10 minutes for a response

--These are your input parameters..

set beVocal to 1 -- if you want the voices off set this to 0 if you want it on set it to 1

set grabforduration to 60 -- Grab frames for 60 seconds..

-- set the grabforduration to how long you want to grab frames for in seconds

set increment to 5 -- Grab a frame every 5 seconds

-- set the increment to how frequently you want to grab a frame at in seconds

set numberOfFrames to 10 -- Grab 10 frames each time

-- set the increment to how frequently you want to grab a frame at in seconds

--Now do it..

tell application "Astro IIDC"

if (start video) then --get camera up and start video displaying..

activate -- bring it to the foreground omit this if you don't want it left as is

set totaltime to (time of the (current date)) + grabforduration

--totaltime is when in the future we want to stop

set nextgrabtime to (time of the (current date)) + increment

--nextgrabtime is when in the future we want the next frame grabbed

if (beVocal > 0) then

say "Frame Capture Starting" using "Bruce"

end if

repeat while ((time of the (current date)) ≤ totaltime)

if (time of the (current date)) ≥ nextgrabtime then -- time has elapsed grab that frames

set nextgrabtime to (time of the (current date)) + increment

set frameCount to 0

repeat while {frameCount < numberOfFrames}

set frameCount to frameCount + 1

grab frame -- grab a frame and save to disk..

repeat while ((grab frame completed) = false)

delay 0.1

--wait for frame grab to complete..

end repeat

end repeat

if (beVocal > 0) then

say "Frame captured." using "Bruce"

end if

end if

end repeat

if (beVocal > 0) then

say "Frame Capture Completed" using "Bruce"

end if

else -- it failed likely because this setting does not exist

say "Video could not start up, is Camera attached?" using "Agnes"

end if

end tell

end timeout

------------------ End OF SCRIPT


HTH..


Milton Aupperle