PURPOSE
This macro will open the Apple Notes app and float one or more notes (i.e., open each note in a separate window). Thus it provides a convenient method to access frequently used notes.
SETTINGS
local_Favorite_Folders_Titles
The Note settings are specified in this text variable. For the required syntax, see the below Comment Syntax Description—SETTINGS (Notes).
local_WindowPositions_x_y_w_h
The window positions and size are specified in this text variable. For the syntax, see the below Comment Syntax Description—SETTINGS (Windows).
local_MultipleDesktopSpaces : 0|1
Two groups can ignore this setting and the next (local_AlwaysPreventSpaceChanges):
- Those NOT using multiple Mission Control Desktop Spaces
- Those using multiple Desktop Spaces, but do not care if running this macro initiates a switch to another Desktop Space, i.e., the space where Notes is already running
Otherwise, those using macOS = local_macOSWithModernBehavior or newer, use multiple spaces, and want to avoid space changes when Notes is running in another space, can set this to 1.
1 [default]
local_AlwaysPreventSpaceChanges : 0|1
If set to 0 and a Desktop Space change could occur, a prompt will appear with two options: 1) Do Not Quit, and 2) Quit and Reopen. The latter, with the trade-off detailed in the dialog, will ensure that the new note opens is the current Desktop Space. If set to 1, a dialog will not be presented, but the Notes app will behave the same as if Quit and Reopen had been selected.
0 [default]
HOT KEY TRIGGERS
• ⌥⇧N : primary Hot Key trigger. This macro processes the SETTINGS (Notes) normally (same as if it was triggered from the KM Editor, a palette, etc.). This Hot Key can be freely changed.
• (any modifier combination)+n, where n is any single character, except N, e.g., ⇧⌘W, ⌥⇧⌘3, ⌃⌥⌘Q : These optional secondary Hot Keys will normally be matched (in the three examples W, 3, Q) to prefixes in the SETTINGS (Notes) variable. If no match is found, this macro functions as if it was triggered from the Keyboard Maestro Editor.
TRIGGERING
If this macro is triggered directly it will use the SETTINGS (Notes). If it is triggered by another macro* (a.k.a. a caller), it will use the SETTINGS (Notes) provided by that macro.
* To ensure that a calling macro is structured properly, duplicate macro Float Specified Apple Notes CALLER TEMPLATE and customize the duplicate as needed.
ACKNOWLEDGEMENTS
This macro includes an AppleScript handler derived from a template created and shared by @JMichaelTX: What is Best Practice for Handling Script Errors in Execute Script Action? - Questions & Suggestions
TESTED WITH
• Keyboard Maestro 10.2
• Ventura beta 13.2 (22D49)/MacBookPro16,1
• Mojave 10.14.16/Macmini6,2
• High Sierra 10.13.6/iMac11,1445
VERSION HISTORY
Click to expand
1.0 - This was based off Float Selected Apple Note with the following enhancements:
a) open one or more notes directly (with $> prefix)
b) open a specific note with a Hot Key Trigger
c) trigger this macro from a calling macro
2.0
a) Added SETTINGS for window positions.
b) Accommodates n: prefixes in the SETTINGS (Notes) from a calling macro.
2.1
a) Set icon to the Apple Notes app.
b) Updated parsing of text lists.
c) Bug fix: n: was not properly detected unless the line also included $>, i.e., n:$>
2.2
a) Changed primary hot key trigger from ⌥⌘N to ⌥⇧N.
b) Changed secondary hot key triggers from ⌥⇧⌘1 to ⌃⌥⇧1 and from ⌥⇧⌘2 to ⌃⌥⇧2.
c) Included minor performance improvements.
d) Included minor adjustments to window position and size.
e) Fixed a few typographical errors in the comments.
f) Updated TESTED WITH.
2.3 - 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.
3.0 - Added two settings to optimize macro behavior when using multiple Mission Control Desktop Spaces: local_MultipleDesktopSpaces and local_AlwaysPreventSpaceChanges.
3.1 - Fixed a dialog typo.
DOWNLOAD Macro File:
Float Specified Apple Notes.kmmacros (209 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.
Float Specified Apple Notes can be triggered (a.k.a called) for another macro. The following is a template that can be duplicated and modified as required.
DOWNLOAD Macro File:
Float Specified Apple Notes CALLER TEMPLATE.kmmacros (21 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.