Topics:   Apple   -   Microsoft   -   Linux   -   Unix

How do I get LAUNCHD to output random filenames?

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?

 

More Stories in Ask Metafilter: Apple