I did. I downloaded the latest version. Check the one I just shared. If you can, make change on that one, because it's already stripped down to the only stuff I need and with the font. I mean, you can update the one you shared of course, but I'm just saying, if you can use that as a template for my current scenario, that would make it easier to test
The version you uploaded works 100% for me, including launching Notes if not running and triggering the "OK" button by keystroke (using either β-Return or β-Enter). What it doesn't like is the "OK" button being clicked -- in that case, the sub-macro doesn't terminate.
So I'm wondering if the sub-macro got left running, which confused things the next time you tried to run the main macro. @noisneil?
Edit to add: Also, IMO, a good example why you shouldn't break HI Guidelines. Default button should be triggered by the Return key, so either use Shift-Return for line breaks in the text field or do away with the default button entirely -- you can still get from text field to adding the note by doing β-Return, Space. Either does away with the sub-macro entirely. I do like your workround, @noisneil, but I think it's going to lead to problems in general use...
For some reason, the CMD+Enter doesn't work at all. I just replaced that with the Click at Found Image and it's working.
The only issue now @noisneil is that the SUB macro keep running. I tried adding a Cancel This Macro at the end of each macro, but no luck. Any other approach to this? We are getting closer
Easy fix. Missed it as I was in a hurry to leave the house earlier (despite what @iamdannywyatt might expect!).
Generally, I'd agree, but this isn't a macro I need myself (I'm on Monterey); it was a particular request by @iamdannywyatt, so I'm just trying to realise his preferences.
Seems to only be you. Do you perhaps have another trigger set to ββ΅?
I'm assuming you mean if you click the OK button. That's fixed now.
Nope... I even disabled all my groups except for the Global Macro Group that can't be disabled, and you Test Group.
Here's the thing: if you run your macro and hit TAB, does it go to the Cancel button and if you click Tab again, does it go to OK? Because mine doesn't. Maybe that's the issue. When I hit tab, it just highlights the text area, regardless of how many times I click.
But as I said, I'm using the Click at Found Image and it's working.
Here's my final version. For those interested in using it while using Catalina (which could be the issue with the CMD+Enter not working) - Macro by @noisneil: New Quick Note.kmmacros (59 KB)
Another version (that's not working for me, but it is for other users using Monterey, for example):
Thanks for sharing.
The macro @noisneil created is doing the job for me, 100% accurately
Maybe yours can be helpful to other people with other goals, since I don't really need the note to open after I create it, for example.
Maybe. The tab is not set as trigger anywhere. If it was, then when I hit it while the new note window is open, it would trigger whatever macro is set to use Tab as trigger, which is not the case.
That's the thing, it does cancel. That's probably another OS difference. I tested it before I shared and just in case, tested it again just now and it stopped. I won't mess with it anymore, because it's working haha
Sorry, you're right; I was looking at the wrong version.
There is one problem though. If you hit escape, it still creates an empty note. Please try the version I just linked to. I changed everything to how you want it, but fixed that issue.
I tried that macro you mentioned. It does work with my Found Image action. Now here's the thing (and maybe that's why the OS is relevant here: at the end of the macro you have the Quit Notes action, but Notes never quit so there's something not working.
But it's ok, because I don't care if Notes keeps running.
The version I shared is working 100% on my end, so I will leave it like that
Don't worry about it. You've done a great job. You can leave the house again for 5 minutes hahah
And what happens when you hit Tab in a "standard" OS dialog, like "Open" or "Save" -- does it behave properly there?
This isn't an OS issue -- the macro works fine in 10.13, 10.14, 10.15, 11 and 12 (I have too many test OSs!) -- but something specific to your setup. You may, or may not, want to spend the time to find out what!
@noisneil I was able to make it work by using a more complex script I found online. I have no idea what's there, as I'm not familiar with AS, but not only is it working now, but the script doesn't need to have that line checking if Notes is running or not.
Here it is, in case you want to check it and maybe update your macro?
set inst to system attribute "KMINSTANCE"
tell application "Keyboard Maestro Engine"
set noteText to getvariable "Local__Note" instance inst
end tell
set noteHTMLText to "<pre style=\"font-family:SF Pro Text,sans-serif; font-size: 14px;\">" & (noteText as Unicode text) & "</pre>"
tell application "Notes" to tell account "iCloud"
-- make new note
set theNote to make new note at folder Β¬
"Notes" with properties {body:noteHTMLText}
-- get its id
try
id of theNote
on error errorMessage
set ATID to AppleScript's text item delimiters
set AppleScript's text item delimiters to "\""
set theID to text item 2 of errorMessage
set AppleScript's text item delimiters to ATID
end try
end tell