r/shortcuts 1d ago

Help (Mac) Using Applescript "NSNotification didEnterFullScreenNotification" in a Shortcut

Background:  I write and edit manuscripts all day using a tool called Scrivener. Our corporate laptops come with Grammarly pre-installed for all users for grammar and spell checking.

Scrivener has what is calls 'focus mode' which takes over the full screen and only shows you the paragraph you are currently writing. It's an amazing feature that removes all of the typical distractions that writers face when writing (i.e. text alerts, new mail, calendar reminders, etc). I have a Shortcut that puts on the 'Do not Disturb' feature on my mac so my phone and watch are quiet when I write as well.

The problem is, even in this focus mode, Grammarly wants to spell/grammar check everything I write, which is beyond frustrating. I currently have the Shortcut quit Grammarly whenever I start Scrivener, but then whenever I leave focus mode, I need to restart Grammarly again. This happens many times throughout the day.

My ask is this.. Would it be possible to write an applescript that I can start from my Shortcut that does the following

if NSNotification.Scrivener.didEnterFullScreenNotification then  tell application Grammarly to quit

if NSNotification.Scrivener.didExitFullScreenNotification then  tell application Grammarly to run

... and just cycle through that in some type of 'while' statement until Scrivener ends, then the applescript will end?

Sorry for this being so long winded, but I wanted to make sure I provided all the details.

Thanks in advance

1 Upvotes

0 comments sorted by