{"id":222,"date":"2006-11-03T13:46:38","date_gmt":"2006-11-03T20:46:38","guid":{"rendered":"http:\/\/www.red-sweater.com\/blog\/222\/flextime-random-sounds"},"modified":"2006-11-03T13:46:39","modified_gmt":"2006-11-03T20:46:39","slug":"flextime-random-sounds","status":"publish","type":"post","link":"https:\/\/redsweater.com\/blog\/222\/flextime-random-sounds","title":{"rendered":"FlexTime Random Sounds"},"content":{"rendered":"<p>Tim Altman <a href=\"http:\/\/www.red-sweater.com\/blog\/219\/flextime-11#comment-22146\">asks<\/a> whether a &#8220;Random Sound&#8221; option might be a good enhancement for <a href=\"http:\/\/www.red-sweater.com\/flextime\/\">FlexTime&#8217;s<\/a> &#8220;Play Sound&#8221; cue type. I think this is an interesting idea, and definitely worth considering. But what can I do for Tim <em>right now<\/em>? <\/p>\n<p>\nAnother case of AppleScript to the rescue.  By setting an activity&#8217;s starting cue to &#8220;Play Sound&#8221; and its finishing cue to <a href=\"http:\/\/www.red-sweater.com\/blog\/downloads\/RandomSound.zip\">RandomSound.scpt<\/a>, we can let FlexTime <em>change its own sound<\/em> 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.\n<\/p>\n<p>\n<img decoding=\"async\" src=\"http:\/\/www.red-sweater.com\/blog\/images\/WakeUp.png\"\/>\n<\/p>\n<p>\nUnfortunately FlexTime doesn&#8217;t expose the list of possible sounds through AppleScript. That&#8217;s another enhancement I&#8217;ll have to consider. But by hardcoding the list of possible sounds in the script, I&#8217;m able to choose a random one until I get something different than what&#8217;s already set. So you&#8217;ll never hear the same sound twice in a row.\n<\/p>\n<p>\nWould it be nice if this was easier? Heck yeah. But the fact a <em>random feature request<\/em> happens to be addressable with AppleScript today is testament to the extensibility of FlexTime.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tim Altman asks whether a &#8220;Random Sound&#8221; option might be a good enhancement for FlexTime&#8217;s &#8220;Play Sound&#8221; 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&#8217;s starting cue to &#8220;Play Sound&#8221; [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,18],"tags":[],"class_list":["post-222","post","type-post","status-publish","format-standard","hentry","category-applescript","category-flextime"],"_links":{"self":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts\/222","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/comments?post=222"}],"version-history":[{"count":0,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts\/222\/revisions"}],"wp:attachment":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/media?parent=222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/categories?post=222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/tags?post=222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}