Created
November 15, 2014 04:22
-
-
Save Softwave/5b04614391223a1cc301 to your computer and use it in GitHub Desktop.
Make a time lapse on OS X
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var count = 0; | |
var command; | |
var interval; | |
var directory = "~/Desktop/"; | |
var sys = require('sys') | |
var exec = require('child_process').exec; | |
function puts(error, stdout, stderr) { sys.puts(stdout) } | |
function takeScreen() { | |
command = "screencapture -x " + "~/Desktop/timelapse/screen" + count + ".jpg"; | |
count += 1; | |
exec(command, puts); | |
} | |
if (process.argv.length < 3) { | |
console.log("Using default settings"); | |
setInterval(function () {takeScreen()},interval); | |
} else { | |
var noodle = parseFloat(process.argv[2]); | |
console.log(noodle); | |
setInterval(function () {takeScreen()},noodle); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment