-
Notifications
You must be signed in to change notification settings - Fork 0
clip
Sean Akahane-Bryen edited this page Dec 31, 2020
·
3 revisions
clip.kmmacros
clip-annotate.kmmacros
Copies the currently selected text in Firefox to a text file, with metadata, optionally with an annotation.
This macro uses a global Keyboard Maestro variable, Last UID
, shared with a number of other macros in this repository so that UIDs assigned in rapid succession (more than one in a given clock minute) don't clash.
Keyboard Maestro has more convenient ways of fetching the title and URL of the active page from Safari and Chrome, which would obviate steps 3 to 6 below.
- (Prompt the user for a note to be appended to the clipped text.)
- Copy the selected text and save it to a variable.
- Simulate the keystroke
⌘L
to select the active page's URL, then copy and saved it to a variable. - Simulate the keystroke
⌘⌥K
to open Firefox's web console. Pause for the console to become active. - Execute the expression
copy(document.title)
to copy the active page's title, then save it to a variable. (Ifcopy(document.title)
appears anywhere in the resulting text file, try lengthening the pause preceding this step.) - Close the developer tools.
- Assign a UID, checking for clashes.
- Create the text file with the UID as its filename.
- Open the text file for the user to check.
Version | Date | Changes |
---|---|---|
1.02 | 2020-12-31 | Replace YYYY with yyyy in ICU date-time pattern |
1.01 | 2020-07-24 | Remove default triggers; use simpler macro names |
1.00 | 2020-07-14 | Initial commit |