I have made attached macro to create a new notes in Apple Notes app. How can I make the title in heading font, as in attached screenshot below?
Hey Ross,
Here's something very basic to get you started:
set noteBody to "
<body>
<h2 style=\"color:black;\">Freedom Rocks!</h2>
<p>
<p style=\"color:black;\" >Come on, feel the noise...</p>
</body>
"
tell application "Notes"
activate
if exists of folder "Notes" then
tell folder "Notes"
make new note with properties {name:" ", body:noteBody}
end tell
end if
end tell
You can't actually set the style of the note title, but this works out basically the same.
Take a look here for more:
AppleScript: The Notes Application
-Chris
Many thanks for that. Is there a way to replace 'Freedom Rocks !' with Input variable as defined in first action of macro?
Hi Ross,
You should be able to use the & to concatenate the strings.
I think this should do the trick:
tell application "Keyboard Maestro Engine"
set noteTitle to getvariable "Input"
end tell
set noteBody to "
<body>
<h2 style=\"color:black;\">" & noteTitle & "</h2>
<p>
<p style=\"color:black;\" >Come on, feel the noise...</p>
</body>
"
Regards,
René
Thanks but does not seem to work - makes title body font.
Strange. It works here.
I put it in a macro.
Can you try this?
If this doesn't work, then perhaps it's a difference in OS/KM versions. I'm on Catalina 10.15.7 and KM 9.2
Regards,
René
Make note.kmmacros (6.3 KB)
Hey Ross,
Please tell us what version of macOS you're using.
Try this macro.
-Chris
Make New Apple Note v1.0.kmmacros (8.2 KB)
Yep that's worked thanks. I'm on Big Sur by the way.