Tim Altman asks whether a “Random Sound” option might be a good enhancement for FlexTime’s “Play Sound” cue type. I think this is an interesting idea, and definitely worth considering. But what can I do for Tim right now?
Another case of AppleScript to the rescue. By setting an activity’s starting cue to “Play Sound” and its finishing cue to RandomSound.scpt, we can let FlexTime change its own sound as it runs. Everytime the activity starts, it plays a sound, and everytime it ends, it changes the sound to something different than it currently is.
Unfortunately FlexTime doesn’t expose the list of possible sounds through AppleScript. That’s another enhancement I’ll have to consider. But by hardcoding the list of possible sounds in the script, I’m able to choose a random one until I get something different than what’s already set. So you’ll never hear the same sound twice in a row.
Would it be nice if this was easier? Heck yeah. But the fact a random feature request happens to be addressable with AppleScript today is testament to the extensibility of FlexTime.