Howdy folks,
Some of you use Alfred for many things, and one of my favorite features is the clipboard manager. I use Keyboard Maestro’s clipboard manager as well, but Alfred has a neat feature called clipboard merging, where double-tapping ⌘C
will append the current clipboard with the currently selected item(s).
However, sometimes I want to quickly disable/enable this feature. This normally involves opening the Alfred preferences, navigating to Features > Clipboard History > Merging
and toggling it there. But this macro reads and writes directly to the clipboard preferences plist file using the built-in macOS PlistBuddy program, allowing this macro to toggle clipboard merging 100% in the background, and instantaneously.
NOTE: The folks over at Alfred have told me that this is not a “published” method of toggling the clipboard merging feature, and therefore may not work with future releases, though they appended that with “it’s likely to always stay the same”.
Enjoy, and feel free to reach out if you need help or have suggestions!
-Chris
RELEASE NOTES, INSTRUCTIONS AND DISCLAIMER
Purpose of this macro (click to expand/collapse)
Quickly toggle Alfred’s clipboard merging feature.
How this macro works (click to expand/collapse)
This macro makes use of macOS PlistBuddy to modify Alfred’s clipboard preferences plist file to enable or disable the clipboard merging feature.
How to configure this macro (click to expand/collapse)
Put the path to your clipboard preferences plist file in the shell scripts.
By default this is:
~/Library/Application Support/Alfred/Alfred.alfredpreferences/preferences/features/clipboard/prefs.plist
Make sure to escape any spaces in the file path. For instance, the above path would become:
~/Library/Application\ Support/Alfred/Alfred.alfredpreferences/preferences/features/clipboard/prefs.plist
NOTE: In the example macro, the path points to a directory in Dropbox since I use that to sync my Alfred preferences between multiple devices.
How to use this macro (click to expand/collapse)
Triple tap the ⌘ button on your keyboard.
By default this is configured for Extended Magic Keyboard and MacBook keyboard.
Disclaimer (click to expand/collapse)
TL;DR: I built it and it works for me. You can share/modify it how you want. But don't blame me if it doesn’t work for you
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
==CURRENT VERSION: 1.0.0 (Friday, April 14, 2023)==
v1.0.0 Friday, April 14, 2023
Initial macro