You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to do this for a while, so i created a .vbs file that opens the action center, and closes it in case it was already open. it depends of a .txt file on the same route to check the notification center status because it's snappy enough for me and works great as is, but you could probably adapt it to a powershell script to be able to check it natively and skip the .txt file and add it as another built in functionality in a future update.
Dim fso, statusFile, status
Set fso = CreateObject("Scripting.FileSystemObject")
' Check if the NotificationStatus.txt file exists
If Not fso.FileExists("NotificationStatus.txt") Then
' If it doesn't exist, create it and write "closed" to it
Set statusFile = fso.CreateTextFile("NotificationStatus.txt", True)
statusFile.WriteLine "closed"
statusFile.Close
End If
' Read the current status from NotificationStatus.txt
Set statusFile = fso.OpenTextFile("NotificationStatus.txt", 1)
status = statusFile.ReadLine
statusFile.Close
' Check if the status is "open" or "closed"
If status = "open" Then
' If the status is "open", send an Escape keystroke to close notifications
Set wshell = CreateObject("WScript.Shell")
wshell.SendKeys "{ESCAPE}"
' Update the status to "closed"
Set statusFile = fso.CreateTextFile("NotificationStatus.txt", True)
statusFile.WriteLine "closed"
statusFile.Close
Else
' If the status is "closed", open the Action Center
Set wshell = CreateObject("WScript.Shell")
wshell.Run "ms-actioncenter:"
' Update the status to "open"
Set statusFile = fso.CreateTextFile("NotificationStatus.txt", True)
statusFile.WriteLine "open"
statusFile.Close
End If
The text was updated successfully, but these errors were encountered:
Are you perhaps talking about Windows 10's Calendar that can be shown using hotkey Win+Alt+D?
If so, you can use this method, which consists of finding out the classname of the calendar/clock notification window and its title to detect it in order to escape otherwise trigger the hotkey Win+Alt+D, for that I'm using Spy tool from AutoHotkey to get the hovered window's classname and title and create the command for hotkeys as follows:
#[Windows.UI.Core.CoreWindow,The Title in your Windows locale given to this window]:(escape)?(_win+_alt+d)
i.e. #[class,title]:(hotkey if found)?(hotkey if not found)
I wanted to do this for a while, so i created a .vbs file that opens the action center, and closes it in case it was already open. it depends of a .txt file on the same route to check the notification center status because it's snappy enough for me and works great as is, but you could probably adapt it to a powershell script to be able to check it natively and skip the .txt file and add it as another built in functionality in a future update.
The text was updated successfully, but these errors were encountered: