How do I get LAUNCHD to output random filenames?
January 26, 2012 5:08 PM Subscribe
Hi all,
I'm trying to create a time lapse of a lego build using 'imagesnap' and 'LAUNCHD' on the mac, but I can't get my script to output a timestamped image or random filenames. It just spits out files named "$RANDOM.jpg" and replaces itself every time. It worked in CRON, but I need the interval control I can get in launchd. Help, please?
Here's the script I'm using now:
(Replace all [ with <>)
[plist]
[dict]
[key]Disabled[/key]
[false]
[key]KeepAlive[/key]
[true]
[key]Label[/key]
[string]syscheck[/string]
[key]ProgramArguments[/key]
[array]
[string]/usr/share/imagesnap[/string]
[string]-t *.jpg[/string]
[string]mv[/string]
[string]/Users/Print/$RANDOM.jpg[/string]
[/array]
[key]StartInterval[/key]
[integer]15[/integer]
[/true][/false][/dict]
[/plist]"
Before, when I used CRON for snaps every minute, I did this:
"* * * * * /usr/share/imagesnap -t *jpg mv /Users/Print/$RANDOM.jpg"
... and it would output random filenames.
What am I doing wrong?>
posted by itsjustcarlo to computers & internet (5 answers total) 1 user marked this as a favorite
posted by scruss at 5:28 PM on January 26