Stairways Software Icon

Stairways Software

Excellence In Software For Over Ten Years – Only with a Mac

Insert Text and Preserving the Clipboard

In versions of Keyboard Maestro before 3.1, when you used Insert Text to paste in some text, the current clipboard was preserved. The way this was done was:

  • Save the old clipboard
  • Set the clipboard to the text to be inserted
  • Simulate Command-V
  • Wait some unspecified amount of time
  • Replace the clipboard with the old clipboard

The problem with this is the “unspecified amount of time”. If it is too short, the old clipboard would be pasted. If it is too long, you might have time to copy something new (and then lose that clipboard!). Typically this manifested itself on slower computers or slower applications where the old clipboard was sometimes pasted instead of the correct text. And nobody likes like inconsistent behaviour!

So in 3.1, we:

  • Added support for Clipboard History and the Clipboard History Switcher
  • Added a macro action to set the clipboard to a past clipboard
  • Added support for Insert Text by Typing
  • Changed Insert Text by Pasting to not preserve the clipboard

If you quite liked the old behaviour, you now have three options:

a) Accept that this is how the macro works, and use the new Clipboard History features (Clipboard History Switcher or the Paste Previous Clipboard macro that is installed disabled in 3.1) to paste whatever you want from your clipboard history.

b) Change your Insert Text macro to Insert by Typing instead of Pasting. This is ideal for the typical case of inserting short text.

c) Add a Pause and a Clipboard->Set Clipboard to Past Clipboard action after your Insert Text macros.  If you have a few of these macros, you might want to change one and keep it open so you can option-drag copy the action to any other macros.

Hopefully this gives you some insight into how we work. The existence of unreliable behaviour drove the change, and the consequences of the change drove the design of new features that produced a more general and better solution than the original way of doing things.

Posted Thursday, June 19, 2008. Permalink. Post a Comment.

Comments

Post Comment

Name: (optional)
URL: (optional)
Email: (optional, not published)
   
CAPTCHA: six five two one (required)
  To prove you are human, please enter the number as digits (ie, 1-9).
Comment:
  You can use some HTML tags such as <b>, <i>, and <a href="">.
We reserve the right to remove any offensive or inappropriate comments.
Due to spam issues, comments are initially invisible until we review them,
you can see them (background red) and we can see them, but no one else.

Comment Preview

None yet.

Buy Now

User Database

Stairways