Apple Notes Macros for Quickly Capturing Text

NOTE: These macros may no longer work and this topic is being left for archival purposes only.

All right, here are a couple of useful Apple Notes macros. I recently decided to stop using and subscribing to Drafts. I freakin' loved that app, but I didn't use all the fancy stuff, so it wasn't worth paying for. Notes will do. But I want it to be unobtrusive and useful, quick and easy. Okay, here are the macros.

Number 1: This allows for quick note creation or appending to an existing note.

APPEND TO NOTE.kmmacros (17.0 KB)

If the note name is not an exact match to an existing note, a new note will be created. When you run the macro again, prompt defaults to the most recent note. The body of the note defaults to the clipboard.

The macros also make linefeeds in the clipped text pretty by making them visible to the note's HTML substrate.

Number 2: Quickly capture the clipboard.

CAPTURE CLIPBOARD.kmmacros (15.2 KB)

Allows you to enter a title or generates a title if none is entered: "CLIPBOARD" and a datestamp. Both macros save the title to the same variable, so that you can append to it later if you want. It prepopulates with the frontmost URL and its title in the very likely event that whatever you are clipping is from that source. You can just blank out the URL input and add a custom title or no title if you want to change that. If you opt for no title, the macro generates a title, same as macro 1 above.

Both macros alert that the note has been created and give the option to show the note. But otherwise the whole process takes place without the need to activate or display the Notes app.

These macros can be tweaked to suit your needs. I cobbled together the Applescripts using exemplars on the web. I would have leveraged Shortcuts but the Notes actions are buggy and suck.

I have found these macros to enhance the usefulness and accessibility of the Notes app for the kinds of tasks for which I use a note taking app. Enjoy!

BTW, I forgot to disable these macros, so be mindful of that when installing. They are triggered by a hotkey. Maybe I'll be less lazy in the morning and take care of that, we'll see....

1 Like

Hey @BKammer, this is not working for me today.

At first I didn't realize I had to add a Note Name. I fixed that and it failed to create a new note as a note did not exist with my name. Then I realized to append a note it needed the exact name of an existing note. It worked when I did that. So 50% there with the Append to Note macro.

The second Capture Clipboard macro seemed to work then failed at the end to create a new note.

Running macOS15.3 and Keyboard Maestro 11.0.3.

Here are the logs while trying out both macros:
2025-02-15 08:06:09 Execute macro ā€œAPPEND TO NOTEā€ from trigger The Hot Key āŒƒā‡§āŒ˜A is pressed
2025-02-15 08:06:28 Action 15625895 failed: Execute an AppleScript failed with script error: text-script:313:318: execution error: Notes got an error: Canā€™t get note "%NoteName%" of account "iCloud". (-1728)
2025-02-15 08:06:29 Execute an AppleScript failed with script error: text-script:313:318: execution error: Notes got an error: Canā€™t get note "%NoteName%" of account "iCloud". (-1728). Macro ā€œAPPEND TO NOTEā€ cancelled (while executing APPEND TO CHOSEN OR LAST NOTE).
2025-02-15 08:06:41 Execute macro ā€œAPPEND TO NOTEā€ from trigger The Hot Key āŒƒā‡§āŒ˜A is pressed
2025-02-15 08:07:11 Action 15625895 failed: Execute an AppleScript failed with script error: text-script:313:318: execution error: Notes got an error: Canā€™t get note "Text km macro note" of account "iCloud". (-1728)
2025-02-15 08:07:11 Execute an AppleScript failed with script error: text-script:313:318: execution error: Notes got an error: Canā€™t get note "Text km macro note" of account "iCloud". (-1728). Macro ā€œAPPEND TO NOTEā€ cancelled (while executing APPEND TO CHOSEN OR LAST NOTE).
2025-02-15 08:07:23 Execute macro ā€œ08)Open the Keyboard Maestro Engine Log in Console or BBEditā€ from trigger Macro Set Palette
2025-02-15 08:08:11 Execute macro ā€œAPPEND TO NOTEā€ from trigger The Hot Key āŒƒā‡§āŒ˜A is pressed
2025-02-15 08:08:45 Action 15625889 failed: Execute a Macro action failed to find the macro to execute
2025-02-15 08:08:45 Execute a Macro action failed to find the macro to execute. Macro ā€œAPPEND TO NOTEā€ cancelled (while executing Execute a Macro).
2025-02-15 08:09:19 Execute macro ā€œAPPEND TO NOTEā€ from trigger The Hot Key āŒƒā‡§āŒ˜A is pressed
2025-02-15 08:09:26 Action 15625895 failed: Execute an AppleScript failed with script error: text-script:313:318: execution error: Notes got an error: Canā€™t get note "Tests" of account "iCloud". (-1728)
2025-02-15 08:09:26 Execute an AppleScript failed with script error: text-script:313:318: execution error: Notes got an error: Canā€™t get note "Tests" of account "iCloud". (-1728). Macro ā€œAPPEND TO NOTEā€ cancelled (while executing APPEND TO CHOSEN OR LAST NOTE).
2025-02-15 08:10:04 Invalid Plug In Action with Name Read the position of a named KM palette
Last message repeated 12 times
2025-02-15 08:10:19 Execute macro ā€œCAPTURE CLIPBOARDā€ from trigger Duplicate Macro Palette
2025-02-15 08:10:36 Action 16666077 failed: Execute a Macro action failed to find the macro to execute
2025-02-15 08:10:36 Execute a Macro action failed to find the macro to execute. Macro ā€œCAPTURE CLIPBOARDā€ cancelled (while executing Execute a Macro).
2025-02-15 08:13:58 Execute macro ā€œ01 - Add new KMF data to collectionā€ from trigger System Clipboard Changed

I am sorry these are frustrating to use. I have to say that I do not use these macros any more as when the macros work, I don't like the outputted note appearance, especially the tiny font. As you point out, the macros just do not produce reliable results. My goal was not to have to open the Notes app to create or append notes, but the macros are more trouble than they are worth. I have found it better to use the native app and its functions. I also found that Notes syncing is not reliable, and I have therefore reverted to a plaintext note taking system using Dropbox. I still use Notes for ephemera. I've also started using Sticky Notes for really non-essential notes. I've automated that using KM to useful effect.

Do you think it's worthwhile to keep them posted here in the forum given their unreliability?

No, I will delete

Apparently, I can't delete unilaterally, I have to flag for administrator.

I don't think there's anything wrong with leaving them here: Whether they work as is or not, they may provide ideas that others can use in their own macros, or perhaps someone will update them so they will work, etc.

They don't do anything destructive, so there's no danger in using them. And anyone finding the macros will find them in this thread that covers the issues, so they're well aware of what they're getting.

-rob.

2 Likes

Have they ever worked for you?

For the "APPEND..." macro, one problem is that the "APPEND TO CHOSEN OR LAST NOTE" is set to abort the macro on failure -- if no note with the desired name is present the macro aborts rather than continuing on to the "CREATE NEW NOTE..." action. Uncheck "Abort..." and you'll get a new note with the text.

The macro won't show the appended/created note because the required script file isn't on your machine -- the macro tries to get it from

/Users/BK/Dropbox/Documents/COMPUTER/KEYBOARD MAESTRO/COMPILED SCRIPTS/NOTES APP GLOBAL/APPEND TO NOTE/SHOW NOTE.scpt

I suspect there are similar problems with "CAPTURE..." macro.

@BKammer -- I'm with @griffman on this. Even better, if you are still using these macros yourself, would be updated versions that fixed the issues mentioned.

I'm left with the sense that you have not read this thread closely. In my reply to @BKammer I said where it did work, yet you are asking me if it has ever worked.

You ask @BKammer if he is still using these macros where he said "I do not use these macros any more"

So it's unclear to me what you are respond to and how to respond to you.

Yes, I meant have the macros ever worked in their entirety for you, without error. They rely on iCloud, for example, and if they worked properly yesterday but not today then you may have signed out and not noticed. But if this is the first time you've tried to run them, start by fixing the errors I mentioned above.

Sorry, missed that bit. But even if they aren't actively using the macros they may still have them on their machine -- and, importantly, may have the missing .scpt file in their Dropbox. The macro can be fixed and the script rewritten if not, but it's usually easier if the originator does that because they know what they were doing the first time round.

Thanks for the clairification.

Here is the "Show Note" script, for what it's worth:

image

And here is a link to my post about my quick note taking system for plaintext notes, if it's useful:

In general, I am disappointed with the automation potential for the Notes app.