User Tools

Site Tools


Clipboards

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Clipboards [2017/03/05 22:21]
peternlewis [Forum]
Clipboards [2021/10/01 03:14] (current)
peternlewis [Display History]
Line 3: Line 3:
  
 **Keyboard Maestro supports several different types of clipboards** **Keyboard Maestro supports several different types of clipboards**
-  * **System Clipboard** ​-- the standard [[https://​en.wikipedia.org/​wiki/​Clipboard_%28computing%29|Mac OS X Clipboard]] used by all Mac apps+  * **System Clipboard** ​— the standard [[https://​en.wikipedia.org/​wiki/​Clipboard_%28computing%29|Mac OS X Clipboard]] used by all Mac apps
       * The alternate name "​**[[token:​CurrentClipboard|Current Clipboard]]**"​ is used in some Macro Actions       * The alternate name "​**[[token:​CurrentClipboard|Current Clipboard]]**"​ is used in some Macro Actions
-  * **Named Clipboards** ​-- Copy of System Clipboard, or other Named Clipboard, created by user for future use+  * **Named Clipboards** ​— Copy of System Clipboard, or other Named Clipboard, created by user for future use
       * There is usually a default *Named Clipboard* named "​Default Clipboard",​ do not confuse this with the Mac’s *System Clipboard*.       * There is usually a default *Named Clipboard* named "​Default Clipboard",​ do not confuse this with the Mac’s *System Clipboard*.
-  * **Past Clipboards** ​-- Prior Versions of the *System Clipboard* stored in the Keyboard Maestro [[#​Clipboard_History]]+  * **Past Clipboards** ​— Prior Versions of the *System Clipboard* stored in the Keyboard Maestro [[#​Clipboard_History]] 
 +  * **Trigger Clipboard** — The clipboard referenced by a [[trigger:​Clipboard Filter]] menu selection (or the System Clipboard otherwise). 
 ===== System Clipboard ===== ===== System Clipboard =====
  
-The System Clipboard is the clipboard that you will use and work with the most.\\+The System Clipboard is the clipboard that you will use and work with the most. 
 + 
 +==== Actions That Use The Clipboard ==== 
  
 (!) Keep in mind that **the System Clipboard is involved in all operations (Actions)** that transfer data between the user interface (documents, menus, web pages,etc) and Keyboard Maestro. (!) Keep in mind that **the System Clipboard is involved in all operations (Actions)** that transfer data between the user interface (documents, menus, web pages,etc) and Keyboard Maestro.
Line 19: Line 24:
   * [[action:​Paste_from_Named_Clipboard]]   * [[action:​Paste_from_Named_Clipboard]]
   * and many others   * and many others
 +
 +==== Pause Until Clipboard Changes ====
 +
 +
 +Sometimes you will need to wait until the app has completed setting the Clipboard. ​ You can use the [[function:​CLIPBOARDSEED|]],​ in a calculation (`CBSeedBefore ≠ CLIPBOARDSEED()`) condition in the [[action:​Pause_Until|Pause Until Action]] to achieve this.  Of course you will need to set the Keyboard Maestro Variable `CBSeedBefore` in an Action _before_ the Action to set the Clipboard.
 +
 +==== Discussion ====
 +
 +
 +The System Clipboard is a complicated entity, and often contains many different flavors of the same data last copied from an app.  To better understand how Keyboard Maestro processes the System Clipboard, see [[https://​forum.keyboardmaestro.com/​t/​ulysses-no-text-in-clipboard/​6742/​23?​u=jmichaeltx | this Forum post by @PeterNLewis]]. ​ In particular, this post deals with getting plain text from the System Clipboard.
  
 ===== Clipboard History ===== ===== Clipboard History =====
 +
 +==== Description ====
  
 The Clipboard History keeps version history of the last two hundred times you have copied something to the System Clipboard. ​  You can then paste any previous system clipboard by triggering the Clipboard History Switcher macro. ​ This is a very powerful and useful feature. The Clipboard History keeps version history of the last two hundred times you have copied something to the System Clipboard. ​  You can then paste any previous system clipboard by triggering the Clipboard History Switcher macro. ​ This is a very powerful and useful feature.
 +
 +==== Options ====
  
 If you enable the *Save Clipboard History to Disk* preference in the Keyboard Maestro General preferences,​ the clipboard history will be saved and restored when Keyboard Maestro Engine is quit and relaunched (such as when you restart or upgrade). ​ Otherwise it will be reset each time you quit the Keyboard Maestro Engine. If you enable the *Save Clipboard History to Disk* preference in the Keyboard Maestro General preferences,​ the clipboard history will be saved and restored when Keyboard Maestro Engine is quit and relaunched (such as when you restart or upgrade). ​ Otherwise it will be reset each time you quit the Keyboard Maestro Engine.
  
-To access the Clipboard ​History ​popup, press the default hotkey of <​key>​⌘</​key><​key>​⌃</​key><​key>​⇧</​key><​key>​V</​key>​ (or a hot key of your choosing).+==== Display ​History ​====
  
-The Clipboard History is a built-in Macro, which you can find in the Keyboard Maestro ​Editor, in the //Switcher Group// in the [[Macro_Groups|Macro Groups]].+The Clipboard History ​Switcher ​is a built-in Macro, which you can find in the Keyboard Maestro ​editor, in the //Switcher Group// in the [[Macro_Groups|Macro Groups]].
  
-For more info, see [Clipboard History Switcher ​documentation](/manual/Clipboard_History_Switcher).+To trigger the Clipboard History Switcher, press the default hotkey of <​key>​⌘<​/key><​key>​⌃<​/key><​key>​⇧</​key><​key>​V</​key>​ (or a hot key of your choosing). 
 + 
 +{{ manual:​clipboardhistoryswitcher.png?​nolink&​674 | Clipboard History Switcher Window }}
  
 You can also use the [[collection:​Clipboard_History]] within the [For Each action](/​action/​For_Each). You can also use the [[collection:​Clipboard_History]] within the [For Each action](/​action/​For_Each).
  
-{{:km-clipboard-switcher.png?​nolink|}}+For more info, see [Clipboard History Switcher documentation](/​manual/​Clipboard_History_Switcher). 
 + 
 + 
 +==== Paste from History ==== 
 + 
 +There is no one built-in Macro or Action that will paste from the _Clipboard History_, but you can easily do this by making use of the [[action:​Set_Clipboard_to_Past_Clipboard]] _Action_. 
 + 
 +For example, to paste from the 2nd item on the _Clipboard History_ (where the latest, most recent item is #1), you can use these three _Actions_ in a macro: 
 + 
 +{{:paste-from-clipboard-history-km-7.3.png?​nolink|}} 
 + 
 +For more discussion on this, see [[https://​forum.keyboardmaestro.com/​t/​how-can-i-get-the-second-to-last-item-in-clipboard/​6615/​6?​u=jmichaeltx | this Keyboard Maestro Forum post]] ​  . 
  
 ===== Named Clipboards ===== ===== Named Clipboards =====
Line 50: Line 83:
       * To restore at end of your Macro.       * To restore at end of your Macro.
       * To use in other Macros.       * To use in other Macros.
- 
  
 (!) Note that Keyboard Maestro provides a named clipboard with the name of "​Default Clipboard"​. ​ It is nothing special, and acts like any other named clipboard. ​ The "​Default"​ in the name means nothing more than that it was provided by default. ​ Do not mistake this for the System Clipboard. (!) Note that Keyboard Maestro provides a named clipboard with the name of "​Default Clipboard"​. ​ It is nothing special, and acts like any other named clipboard. ​ The "​Default"​ in the name means nothing more than that it was provided by default. ​ Do not mistake this for the System Clipboard.
 +
 +Named Clipboards are located in the Keyboard Maestro Preferences in their own “Clipboards” panel.
 +
 +{{:​keyboard_maestro_named_clipboard_prefs.png?​direct&​400|}}
 +
 +Use the [+] button to create a new named clipboard.
 +
 +The one-line field at the top-right is the name field.
 +
 +The big field on the lower-right is the content field.
 +
 +You can add plain text, styled text, and images simply by pasting into the content field, but if you want to add something like a Keyboard Maestro action you need to use a Copy to Named Clipboard action to get it in there.
 +===== Trigger Clipboard =====
 +
 +The Trigger Clipboard is not a clipboard per se, but a reference to a clipboard, either the System Clipboard, a past clipboard in the Clipboard History, or a Named Clipboard. ​ It is the clipboard referenced by a [[trigger:​Clipboard Filter]] menu selection in the Clipboard Switcher.
  
 ===== Clipboard Actions ===== ===== Clipboard Actions =====
Line 64: Line 111:
     * [[action:​Paste]]     * [[action:​Paste]]
     * [[action:​Delete_Past_Clipboard|Delete Current or Past Clipboard]] in the history of the System Clipboard     * [[action:​Delete_Past_Clipboard|Delete Current or Past Clipboard]] in the history of the System Clipboard
 +    * [[action:​Set_Variable_to_Text#​Set_to_The_Clipboard|Set Variable to Text Action]] using [[token:​CurrentClipboard|]] [[Tokens|Token]]
   * **All Clipboards**   * **All Clipboards**
     * [[action:​Display_Clipboard]]     * [[action:​Display_Clipboard]]
Line 69: Line 117:
     * [[action:​Copy_Clipboard_to_Clipboard]]     * [[action:​Copy_Clipboard_to_Clipboard]]
     * [[action:​Apply_Style_to_Clipboard]]     * [[action:​Apply_Style_to_Clipboard]]
-    * [[action:Filter_Clipboard]]+    * [[action:Filter]]
     * [[action:​Search_and_Replace_Clipboard]]     * [[action:​Search_and_Replace_Clipboard]]
     * [[action:​Search_Clipboard]]     * [[action:​Search_Clipboard]]
Line 83: Line 131:
 ===== Clipboard Tokens ===== ===== Clipboard Tokens =====
  
-In addition to the above Actions that use Clipboards, there are several Clipboard Tokens that can be used in any Action which has a field for Clipboards, Variables, or text.\\+In addition to the above Actions that use Clipboards, there are several Clipboard Tokens that can be used in any Action which has a field for Clipboards, Variables, or text. 
 These Include: These Include:
 +
   * [[token:​CurrentClipboard|%CurrentClipboard%]] (same as System Clipboard)   * [[token:​CurrentClipboard|%CurrentClipboard%]] (same as System Clipboard)
   * [[token:​NamedClipboard|%NamedClipboard%]]   * [[token:​NamedClipboard|%NamedClipboard%]]
   * [[token:​PastClipboard|%PastClipboard%]]   * [[token:​PastClipboard|%PastClipboard%]]
  
-===== See Also =====+===== Clipboard Condition ​=====
  
-----+The [[condition:​Clipboard|Clipboard Condition]] may be used with [[Actions|Macro Actions]] like [[action:​If_Then_Else|IF/​THEN]] to branch control based on criteria concerning the data on the Clipboard. ​ For details see: [[condition:​Clipboard|Clipboard Condition]] 
 + 
 + 
 +===== See Also =====
  
 === Actions === === Actions ===
Line 101: Line 154:
 * [[:​Actions|See all Actions]] * [[:​Actions|See all Actions]]
  
-----+=== Functions === 
 + 
 +* [[function:​CLIPBOARDSEED|]] ​-- used to determine when Clipboard has changed 
 + 
 +=== Triggers === 
 + 
 +* [[trigger:​Clipboard Filter]] trigger
  
 ==== Forum ==== ==== Forum ====
Line 109: Line 168:
  
 - [[https://​forum.keyboardmaestro.com/​search?​q=Clipboard|Keyboard Maestro Forum topics about Clipboard]] - [[https://​forum.keyboardmaestro.com/​search?​q=Clipboard|Keyboard Maestro Forum topics about Clipboard]]
 +
 ==== External Sites ==== ==== External Sites ====
  
 * [Using Named Clipboards at MacAutomationTips](https://​macautomationtips.wordpress.com/​2013/​06/​08/​how-to-use-named-clipboards-in-keyboard-maestro/​) * [Using Named Clipboards at MacAutomationTips](https://​macautomationtips.wordpress.com/​2013/​06/​08/​how-to-use-named-clipboards-in-keyboard-maestro/​)
Clipboards.1488770502.txt.gz · Last modified: 2017/03/05 22:21 by peternlewis