{"id":255,"date":"2023-06-13T10:00:00","date_gmt":"2023-06-13T17:00:00","guid":{"rendered":"https:\/\/dejal.com\/blog\/?p=255"},"modified":"2023-05-29T17:37:06","modified_gmt":"2023-05-30T00:37:06","slug":"can-i-add-time-out-breaks-to-my-calendar","status":"publish","type":"post","link":"https:\/\/dejal.com\/blog\/can-i-add-time-out-breaks-to-my-calendar\/","title":{"rendered":"Can I add Time Out breaks to my Calendar?"},"content":{"rendered":"<body><p><\/p>\n<p>I had a customer wish that <a href=\"https:\/\/dejal.com\/timeout\/\">Time Out<\/a> could track breaks taken in their <strong>Calendar<\/strong> app. That is definitely an interesting idea, so I added it to my feature concepts list for consideration in a future version, but it occurred to me that we could probably do that now with AppleScript actions.<\/p>\n<p>As you may know, Time Out has the ability to perform various actions before, during, or after a break occurs. I made two AppleScripts based on Apple\u2019s sample code for the <strong>Calendar<\/strong> app, and added them to the <strong><a href=\"https:\/\/dejal.com\/timeout\/extras\/\">Time Out Extras<\/a><\/strong> page.<\/p>\n<p><a href=\"https:\/\/dejal.com\/timeout\/extras\/scripts\/ds-add-to-calendar.zip\">Download the scripts now<\/a>.<\/p>\n<p>The \u201cAdd to Calendar Start\u201d script creates a new \u201cTime Out break\u201d event in the first available calendar, at the current time, with a duration of an hour. To use this in Time Out, install it as normal (reveal the scripts folder via the + button on the <strong>Break Actions<\/strong> page, and add the two scripts there), then add an action set to be performed \u201cAfter Start\u201d.<\/p>\n<p>The \u201cAdd to Calendar End\u201d script finds that event (assuming it is still within that hour), and updates the end time to the current time. So to use this, add an action set to be performed \u201cAfter Any End\u201d (i.e. when the break finishes, done or not).<\/p>\n<p>Here\u2019s how it\u2019ll look in Time Out (with a couple of sound actions for good measure):<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/dejal.com\/files\/2019\/timeout\/calendar\/actions.png?resize=594%2C458&#038;ssl=1\" alt=\"Time Out actions\" width=\"594\" height=\"458\" border=\"0\" loading=\"lazy\"><\/p>\n<p>If you want to add the events to a different calendar, you can edit the scripts (I included a commented out example). Just make sure you change both the same way.<\/p>\n<p>I may add a more integrated calendar feature in the future, but in the meantime, it\u2019s great that such enhancements can be done immediately. I hope this is helpful to some people.<\/p>\n<p><\/p>\n<\/body>","protected":false},"excerpt":{"rendered":"<p>I had a customer wish that Time Out could track breaks taken in their Calendar app. That is definitely an interesting idea, so I added it to my feature concepts list for consideration in a future version, but it occurred to me that we could probably do that now with AppleScript actions. As you may [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[16,3],"tags":[],"class_list":["post-255","post","type-post","status-publish","format-standard","hentry","category-faq","category-time-out"],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/posts\/255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/comments?post=255"}],"version-history":[{"count":1,"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/posts\/255\/revisions"}],"predecessor-version":[{"id":256,"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/posts\/255\/revisions\/256"}],"wp:attachment":[{"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/media?parent=255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/categories?post=255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/tags?post=255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}