KM causes Adobe InDesign to crash when copying

I’m working with the latest version of Adobe InDesign. Sometimes when copying items in InDesign, InDesign will crash suddenly and Keyboard Maestro will freeze. I have to force-quit KM from Activity Monitor after that.

This does not happen if KM isn’t running.

This is more or less reproducible if that helps.

It may be related to this Illustrator issue:

Check the InDesign preferences for copying and see if any of them affect the behaviour.

1 Like

I turned off all the fancy clipboard options, and I haven’t had a crash since. Thanks!

1 Like

I am getting this same problem and have isolated it to text boxes with auto-expand width set on them. I have reported it on the Adobe Forums too here and it seems to be getting some consensus

https://forums.adobe.com/message/10105489#10105489

When you say you turned off all fancy clipboard options, do you mean in KM? Which ones?

Thanks

Alan

I can replicate this with InDesign CC 2018.

But —on my machine— the issue is in no way limited (or caused) by KM Engine.

After a (short) test it seems the culprit is InDesign’s Copy PDF to Clipboard setting:

If this is selected then any paste attempt to any other app will result in a hang.


Steps to replicate:

  1. Quit KM Engine

  2. In InDesign set up a document with a text box as described here:

New document
Create simple text box
Write any text in the box
Go to Object > Text Frame Options
Choose Auto-size - Width Only

  1. Make sure Copy PDF to Clipboard is selected in InDesign’s prefs (see screenshot above).

  2. Copy the text box in your document.

  3. Now try to paste in any of these apps:

  • TextEdit
  • Stickies
  • Notes
  • Adobe Illustrator
  • Or with Preview choose New from Clipboard (⌘N)

In every case I get the Beachball (hang) until I force-quit InDesign.

Even Apple’s Clipboard Viewer (part of Additional Tools for Xcode) hangs when trying to access the PDF clipboard content:

Also, if you invoke LaunchBar with your LaunchBar hotkey, it will hang immediately (it is also trying to read the clipboard, if its clipboard history is activated).


So, IMO, there is some incompatibility between InDesign’s PDF Clipboard and Apple’s clipboard API in general. (If the clipboard contains an auto-width box.)

The thing with KM Engine is that it is running constantly in the background, so it is trying to read the clipboard immediatly after copying, which makes you think it was the culprit. But obviously no app is capable to read that clipboard without hanging.


The easiest workaround: If you don’t need the PDF clipboard then disable the Copy PDF to Clipboard setting.

I don't know if I should make a new post, but i'm having almost the exact issue, but in Citrix.

In the Citrix "Windowsy" environment, the copy key combo is the ⌃C Keystroke

If I invoke it once, there is no crash. If I do it quickly a second time (which I do all the time--a nervous habit) like so: ⌃C⌃C, then the Citrix window crashes. It does not, however, trigger a Crash Reporter window in OS X. (I'm on High Sierra).

What's really interesting is that the KM menubar item is completely frozen, every time.

What's even more interesting is that it will un-freeze after almost exactly 60 seconds, every time, with the KM menu bar item opening and closing in rapid succession, as if the mouse click events are suddenly catching up.

I have run the "Start Debugging" menu and watched the window carefully. I can't see that there is KM macro being triggered here.

I've tried to go into Activity Monitor or Console to see what's going on, but I can't even find a KM log in there to look at.

Keyboard Maestro (and presumably any other clipboard history application) reads all (mostly all) the flavors on the clipboard whenever the clipboard changes. I don't know why Citrix is crashing. My guess would be that it is crashing because Keyboard Maestro is trying to read the clipboard and the clipboard has already been abandoned for the second copy. As for Keyboard Maestro freezing, that is probably because the clipboard API is largely synchronous, and the system is probably trying to read the clipboard and then Citrix crashes and so does not respond, and meanwhile Keyboard Maestro is locked up waiting, and then eventually the system give up (times out) and returns an error, and Keyboard Maestro continues on its merry way.

You can get a sample of Keyboard Maestro Engine from Activity Monitor, but I doubt it'll be useful, it almost certainly will just show Keyboard Maestro spending all its time in a clipboard (aka Pasteboard) API call.

I'm not sure what to suggest as a resolution other than “don’t do that” and/or reporting the issue to Citrix (presumably if Citrix did not crash the issue would be resolved and/or excluding Citrix from Keyboard Maestro’s clipboard history.

Thanks for the info. The path of least resistance is definitely to change my habits.

One piece of info I left out: if I disable the KM engine and THEN do the double copy procedure, there is no crash.

That isn't surprising because the first clipboard that no longer exists is not being read - it is reading that first clipboard but after it has already been replaced that is likely the cause of the crash.

The sequence is likely:

  • Citrix copies the first clipboard
  • Keyboard Maestro notices this
  • Citrix copies the second clipboard
  • Keyboard Maestro tries to read the first clipboard
  • Citrix has already abandoned that information and crashes.
  • Keyboard Maestro gets locked up waiting for the read to finish

Thank you for your replies. And, once again, Keyboard Maestro comes to the rescue.

I was able to bypass this bug (and keep my bad habit!) by using KM to intercept any ⌃C⌃C sequence in Citrix, and substitute a single ⌃C instead:
05%20PM

Thanks so much for such a wonderful product, and for such great support

Michael

It is generally not recommended to simulate a keystroke that is an active hot key. Keyboard Maestro tries to “do the right thing” and disable the hot key, simulate the keystroke and then re-enable the hot key, but since the system/application can take an unknown amount of time to process the keystrokes, it is possible the simulated hot key to trigger the macro instead.

So keep that in mind, though if it is working for you, that's fine obviously.

Personally I would add a Beep action or a Speak Text "Stop it!" to the macro to break you of the habit.

1 Like