Jump to content
vitor

CalmNotifications — Toggle Do Not Disturb

Recommended Posts

Hello! Complete newbie here, running Alfred 3.6 on Mac OS 10.9.5

 

Nothing happens when typing in dnd (I have allowed Alfred to control my computer in the privacy settings).

 

Could you please advise?

 

Thanks!

Share this post


Link to post

Welcome @Christophe,

 

Unfortunately, your macOS version is too far behind for me to be able to help. The solution needed to toggle Do Not Disturb is already somewhat hacky, and as far as I can tell earlier versions of macOS required different methods.

Share this post


Link to post

Thanks Vitor for your response. I suspected that the OS might be the problem. Your workflows that only work within Alfred (eg Ping Pong or FormatSize) work well, but any other that trigger something outside (like dnd, TemplatesManager, TemporaryEmail) don't do anything.

 

Maybe one day I'll upgrade my OS :P (or learn to code!)

Share this post


Link to post
3 hours ago, Christophe said:

any other that trigger something outside (like dnd, TemplatesManager, TemporaryEmail) don't do anything.

 

TemplatesManager is expected not to work, as it uses JavaScript for Automation (JXA) and that was only introduced in Yosemite (10.10). As for TemporaryEmail, it uses regular AppleScript, so it should work, unless something has changed since Mavericks.

 

Workflows of mine that should work for you are the ones that don’t interact with a GUI, as for that one needs AppleScript/JXA. So macOS-specific apps/features (Finder, Notification Center) and browser interactions are out. Some of the older ones might still work, like IncognitoClone.

 

But you should really update your OS. By staying so far behind you’re exposing yourself to some potentially nasty bugs.

Share this post


Link to post
5 hours ago, akishaha said:

Its not working on High Sierra. ☹️ Can anyone help me ?

 

Welcome @akishaha,

 

Please don’t post “it’s not working” messages, as that doesn’t help us help you. How is it not working? What were the exact steps you took? What happened (or didn’t)?. What was the out put of the debugger with the log output set to “All Information”?

 

Here’s how to post an effective bug report:

 

Share this post


Link to post

Minor issue: Toggling dnd off ("turn it off") works, but the Notification Center icon remains dimmed as though Do Not Disturb is still on. I'm using High Sierra 10.13.6

 

Do Not Disturb on

1403864778_dndon.png.c359835ad865434987ceee01907a2572.png

 

Do Not Disturb off 

1795580742_dndoff.png.ec7550451a93354643887893d6efcde5.png

 

If I toggle Do Not Disturb off manually, it reverts to the darker icon as a visual cue. If I toggle using the workflow it remains faded.

 

 

Share this post


Link to post
On 2/25/2018 at 12:45 AM, vitor said:

The solution needed to toggle Do Not Disturb is already somewhat hacky

 

Saw this remark from a while ago, and things may have changed.  What method do you use to adjust this setting ?

Share this post


Link to post
7 hours ago, evanfuchs said:

Minor issue: Toggling dnd off ("turn it off") works, but the Notification Center icon remains dimmed as though Do Not Disturb is still on.

 

That may not be something fixable, due to the nature of the hackiness required.

 

7 hours ago, evanfuchs said:

I'm using High Sierra 10.13.6

 

I’m on Sierra, but I will update to Mojave. If I look at this, it will be then.

 

2 hours ago, CJK said:

Saw this remark from a while ago, and things may have changed.

 

Unlikely. Apple is making automation harder, not easier.

 

2 hours ago, CJK said:

What method do you use to adjust this setting ?

 

The defaults method. It’s easier if you open the Workflow and see for yourself; it’s straightforwards Bash, and just a few lines.

Share this post


Link to post
On 9/16/2018 at 6:14 PM, vitor said:

The defaults method. It’s easier if you open the Workflow and see for yourself; it’s straightforwards Bash, and just a few lines.

 

Thanks for sharing.  I need to implement this in AppleScript.  I don't have Alfred, but I downloaded your Workflow, but don't see the Bash.  Would you mind posting the Bash here, or providing a direct link to it?

 

Thanks.

Share this post


Link to post
6 hours ago, JMichaelTX said:

Would you mind posting the Bash here

 

action="${1}"

if [[ "${action}" == 'on' ]]; then
  defaults -currentHost write "${HOME}/Library/Preferences/ByHost/com.apple.notificationcenterui" doNotDisturb -boolean true
  defaults -currentHost write "${HOME}/Library/Preferences/ByHost/com.apple.notificationcenterui" doNotDisturbDate -date "$(date -u +'%Y-%m-%d %H:%M:%S +0000')"
  killall NotificationCenter
else
  defaults -currentHost write "${HOME}/Library/Preferences/ByHost/com.apple.notificationcenterui" doNotDisturb -boolean false
  killall NotificationCenter
fi

 

Share this post


Link to post

Hi Victor,

Thanks for the worklfow, but I am having the same issue (in macOS 10.13.6) that when I turn DND off, the Notification icon in menu bar does NOT turn from Grey back to Black.

Please advise.

Thanks,

Matthew

Share this post


Link to post
13 hours ago, mlondon said:

Thanks for the worklfow, but I am having the same issue (in macOS 10.13.6) that when I turn DND off, the Notification icon in menu bar does NOT turn from Grey back to Black.

 

The old post still applies:

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...