MACRO: New Apple Note, v1.2

PURPOSE

This macro will create a new Apple Note and open it. The new note can be optionally floated and positioned.

Monterey includes an Apple Notes feature called Quick Note. Since this macro provides similar capability, its value is less obvious for Monterey (or later) users. However, if the Notes Preference Resume last Quick Note is checked, one could use the native Quick Note feature for an ongoing scratchpad and, in tandem, use this macro for collecting information that should be segregated from the Quick Note information.


SETTINGS

local_FloatNewNote : 0|1
Determines if the new note is opened in a separate window or if it is displayed in the note folder.
0 = no
1 = yes [default]

local_NotesFolder
The destination folder for the new note. If the folder does not exist, it will be created.
_INBOX [default]

local_FloatPositionAndSize : X Y W H
Four integers separated by spaces: top-left X position, top-left Y position, Width, Height (all in display percentages)
0 10 50 25 [default]


TESTED WITH

• Keyboard Maestro v10.2
• Ventura Version 13.0 Beta (22A5342f)/MacBookPro16,1
• Mojave 10.14.16/Macmini6,2
• High Sierra 10.13.6/iMac11,1445


VERSION HISTORY

1.0 - Initial version

1.1 - Modified to accommodate macOS Ventura (v13.x). In this version the Notes app menu item Window>Float Selected Note was changed to Window>Open Note in New Window.

1.2

  • Bug fix: Mistakenly had local_macOSWithFloatMenuItemRenamed in the outside If action; it has been corrected to local_macOSWithModernBehavior.
  • When floating a note on pre-Monterey, added two Forward Delete keystrokes as suggested by @August.

DOWNLOAD Macro File:
New Apple Note.kmmacros (42 KB)
Note: This macro was uploaded in a DISABLED state. It must be ENABLED before it can be run. If it does not trigger, the macro group might also need to be ENABLED.

Macro-image

2 Likes

Users of Apple Notes might find this macro also useful: Float Specified Apple Notes

2 Likes

I've updated the OP with Version 1.1 of New Apple Note.

Modified to accommodate macOS Ventura (v13.x). In this version the Notes app menu item Window>Float Selected Note was changed to Window>Open Note in New Window.

1 Like

Thanks for this macro @_jims, it looks useful.

In initial tests, I notice that it closes the "main" Notes window and just leaves the floating notes, including the new one, whether or not the "main" Notes window was open in the first place. Over the long haul, I imagine that I might prefer to have the main Notes window remain in whatever state it had been. I presume you have to open it in order to make the new note (I haven't dug in under the hood yet).

Also, and this is by far the bigger annoyance to me, it appears to always make the new note floating in whatever Desktop the main Notes window happens to be in when I invoke the macro.

I can imagine workflows in which, while working on something, you want to save a note in your Notes INBOX to deal with later, in whatever Desktop it happens to be in (maybe even a dedicated Desktop for "inboxes" like that) and then return to what you are doing. Personally, I think (but don't yet know from experience) that I would more often rather have the new noted floating on whatever Desktop I was working on. I can do that if I close the main Notes window first. Then that window is temporarily opened in my current Desktop and then closed after the new note is floated.

Because your flow involves closing the main Notes window, whether or not it was originally open, maybe I could get what I wanted by closing the main Notes window first (via AppleScript, so it could be closed without having to change Desktops) and then opening it to create the new note. I think that could result in the new note floating in my current Desktop.

So that's going to require the AppleScript get a list of Notes widows titles and if any of them are titled "Notes", then close that window. (More steps than I have time for this afternoon because knowing what has to happen doesn't mean that I know how to get AS to do it, yet.)

Now that I'm thinking about that scenario, I imagine multiple subfolders of the INBOX, one for each Desktop, and the new notes would be created in those subfolders as well as being placed on the appropriate desktop. The Notes app is actually pretty good about maintaining previous Desktop positions through a reboot, but I don't know if it remembers through the app being closed, so saving new notes Desktop by Desktop might be useful in restoring the working arrangement if it gets lost for some reason.

And all of that is way more than your original goal for this macro, so please don't think that I am asking you to indulge my personal "Feeping Creatureism", I'm just brainstorming here with a hopefully like-minded explorer. What do you think? If I ever got around to building it, would you use it?

Hi, @August. You're welcome.

Yes, the macro minimizes that window. This was a design choice I made. But you could easily change it if you want.

That's how the Notes app works (even if the main photo window visible, minimized, or hidden). Again this was a design choice I made, but you could easily change that behavior by modifying the macro to first close the Notes app if it is open.

Easy to do; no AppleScript required.

Keyboard Maestro Export

yes, but...

You might want to check out another macro I've shared: Float Specified Apple Notes

1 Like

Um, No. That quits the entire Notes app, including any other floating windows, right? I want to only close the main Notes window and leave any other floating windows open. For that I think I need AppleScript to get a list of open Notes windows, but I could be wrong.

And I suppose Float Specified Apple Notes could be used to reopen the floating notes after the Notes app got closed and reopened, but that starts to seem complicated, as does getting all the floating notes back to their original Desktops. So simply quitting Notes does not work for my purposes.

Hi @_jims,

WRT the extra blank line before the Title in the newly created Note, I made the following addition to your macro:

image

I copied your conditional structure for versions, removed the Execute AppleScript in a couple of places while leaving the Newer and Older comments in as placeholders. That allowed my new steps to only happen in the same conditions as the AppleScript for Older than Monterey which adds the erroneous blank line.

I wait until the new note called "Title" is frontmost (this might not actually be necessary, but it makes my intent clear) and then I do two Forward Delete keystrokes to delete the zero-width space and the EOL.

In practice, I never even see the blank line.

2 Likes

Thanks for the suggestion, @August. I've included that change in v1.2.

I've updated the OP with Version 1.2 of New Apple Note.

  • Bug fix: Mistakenly had local_macOSWithFloatMenuItemRenamed in the outside If action; it has been corrected to local_macOSWithModernBehavior.

  • When floating a note on pre-Monterey, added two Forward Delete keystrokes as suggested by @August.