Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { appleScript, i } = require("./as");
- const tellSystemEvents = appleScript`
- tell application "System Events"
- ${i}
- end tell
- `;
- const tellSystemUI = tellSystemEvents`
- tell process "SystemUIServer"
- ${i}
- end tell
- `;
- const isOpen = tellSystemEvents`exists window "Notification Centre" of process "Notification Centre"`;
- const toggle = tellSystemUI`
- click menu bar item "Notification Centre" of menu bar 1
- `;
- const open = appleScript`
- if not (${isOpen.use()})
- ${toggle}
- end if
- `;
- open.run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement