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 change this setting to 0 and ignore the next setting, 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 three options: 1) Cancel, 2) Do Not Quit, 3) Quit and Reopen. The latter will ensure that the new note opens is the current Desktop Space (with the trade-off detailed in the dialog). 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.4.1 (22F82)/MacBookPro16,1
• Mojave 10.14.16/Macmini6,2
• High Sierra 10.13.6/iMac11,1445
VERSION HISTORY
( expand / collapse )
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.
3.2
a) Centers the Notes is running dialog and added information for those that do not use multiple Desktop Spaces.
b) When positioning floated windows, existing Apple Notes windows are counted. For example, if two Notes windows are already open when the macro is triggered, the first window opened by this macro will be in positioned as if it is the third window (per the SETTING: local_MultipleDesktopSpaces).
c) If the windows exceed the positions defined, the positions will be reused.
d) updated TESTED WITH section.
Download: Float Specified Notes.kmmacros (212 KB)
Macro-Notes
- Macros are always disabled when imported into the Keyboard Maestro Editor.
- The user must ensure the macro is enabled.
- The user must also ensure the macro's parent macro-group is enabled.
System Information
- macOS 13.4.1 (22F82)
- Keyboard Maestro v10.2
Float Specified 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: Float Specified Notes CALLER TEMPLATE.kmmacros (22 KB)
Macro-Notes
- Macros are always disabled when imported into the Keyboard Maestro Editor.
- The user must ensure the macro is enabled.
- The user must also ensure the macro's parent macro-group is enabled.
System Information
- macOS 13.4.1 (22F82)
- Keyboard Maestro v10.2