Copying certain objects from Illustrator CC2015 is slow

Hi Peter

My tests shows that if I exclude all flavours then it works for me.
There is no delay. I can still paste in Illustrator and InDesign. These are the normal places I need to copy graphics to.
Can I set this myself on my system or does this require an update to KM?

Excluding all flavors would apply in all apps, not just in Illustrator, so it is not a solution. The result would be serious problems in using Keyboard Maestro. The purpose of those exclusions is to avoid specific problematic flavors (such as ones that are intended to be internal to the application), not for excluding applications.

Is it then possible to disable the clipboard history without stopping the KM Engine?

No, the clipboard history is deeply ingrained in the engine.

Jimmy, I'm not sure I fully understand your issue, but thought I'd just throw out this idea in case it might help.

How about writing an AppleScript that toggles the KM engine off/on?
You could then do your copy/paste in Illustrator, and toggle KM back on.

You can use tools like FastScripts to assign a shortcut to your script.

That is a good idea. And @Tom made an AppleScript in this post, which I could modify and use.
I do not use FastScripts, but the built-in Scriptsmenu, which can be activated in the settings of the ScriptEditor.

At first run this ApplesScript quits the KM Engine.
Then I can without problems copy and paste in/between Illustrator and InDesign.
When I run it again it sets the clipboard to nothing, before starting the KM Engine again.

I would like to thanks this extremely great forum for help to find a work-around. :grinning: :+1:

@peternlewis: A feaure-request is still to have an exclude list for the clipboard management of KM. But it is probably not easy to implement.

Toggle KM Engine.scpt.zip (3.0 KB)

# Orignal made by Tom from http://dflect.net/en/ and published on the Keyboard Maestro forum (https://forum.keyboardmaestro.com/t/making-km-more-accessible-for-non-geeks/3261/12)
# Modified to only Quit Keyboard Maestro Engine and before enabling it again it clears the clipboard.
# This is to help with an issue with Keyboard Maestro and Adobe Illustrator and Adobe InDesign discussed on this thread (https://forum.keyboardmaestro.com/t/copying-certaing-objects-from-illustrator-cc2015-is-slow/3134)
# Activate the scripts menu in the Scripteditor and put it there for easy access

property appsToShutdown : {"Keyboard Maestro Engine"}
property wasRunningBefore : {}

if application "Keyboard Maestro Engine" is running then
	
	set wasRunningBefore to {}
	repeat with i in appsToShutdown
		if application i is running then
			try
				set wasRunningBefore to wasRunningBefore & i
				tell application i to quit
			end try
		end if
	end repeat
	
else
	
	if wasRunningBefore is {} then set wasRunningBefore to appsToShutdown
	tell application "System Events" to set the clipboard to ""
	repeat with i in wasRunningBefore
		try
			tell application i to launch
		end try
	end repeat
	
end if

--log wasRunningBefore

90% of the script you don’t need for this.

This should do it:

property kmEngine : "Keyboard Maestro Engine"

if application kmEngine is running then
	tell application kmEngine to quit
else
	tell application "System Events" to set the clipboard to ""
	tell application kmEngine to launch
end if

Here as a Workflow, so you can assign it a hotkey in System Preferences > Keyboard > Shortcuts > Services:

Toggle KM Engine.workflow.zip (72.7 KB)

(Copy the Workflow to ~/Library/Services.)

Hi Tom

Thanks. This works as expected.
Nice idea with the Workflow, so I can set a Keyboard shortcut on it.

How do you exclude exclude flavors while copying a selection?

You can’t in general. There are some specific problematic flavors that are excluded (eg private flavors that broken applications explode or misbehave when you read them), but there is no way to exclude flavors from specific applications or in specific instances.

Peter, thanks so much for your prompt reply. That was fast!

My application involves copying patient face sheet data from large commercial software written in Microsoft’s no longer supported Visual Basic. KM does a fantastic job with placing this text data into variables using a regular expression. But the actual copying of the face sheet data is inconsistent. The only real option I seem to have is command-A (select all), then copy. About half the time, the copy operation completes immediately. But unfortunately, for the other half, it hangs for 60 seconds, and then moves on. They all have similar formats comprising mostly text, but with embedded separation lines. It seems that a given patient’s face sheet either works every time, or it hangs for 60 seconds every time. But the copy operation does not hang if the copy is done manually without the KM engine. Any ideas or suggestions?

If it is a particular flavour of data that causes the problem, and if that flavour is some proprietary flavour, then you can probable exclude it from the clipboard history system.

To find out, hold option and shift down and select Start Debugging from the Keyboard Maestro status menu. That will start the clipboard flavour debugging system in Keyboard Maestro.

As described in the resulting window, copy something that causes problems. Keyboard Maestro will list the flavours and exclude everything except the standard flavours. Now try copying again and see if the issue is fixed. If so, adjust the minimum number of excluded flavours (minimum entries checked) the removes the problem and report them to me.

Note that if you have to exclude everything, including things like plain text, rtf and pdf and such, then this system cannot help. If you only have to exclude some proprietary flavour, then it can probably be safely disabled universally.

Peter, your reply was spot on. My copy procedure turned out to involve 4 flavors: public.rtf turned out to be the offender. By checking its box, my copies all seem to work. I don't know if this feedback will help you, but the discovery helped me tremendously. Thank you!

So it seems the act of generating the RTF is what is causing the problem.

Unfortunately there is nothing that can be done in that case - public.rtf could not be excluded in general, and Keyboard Maestro has no ability to exclude specific falvours in specific applications. I may eventually after that, but it would be pretty ugly.

Hi,

With the latest version of Illustrator (2015.3 v.20.0.0), Illustrator completely hangs when copying something and Keyboard Maestro is running :frowning:

See related topic on the Adobe forum.

In my opinion it is an Ai bug....

Thnx to a direct mail from Peter, I've the work-around:

  • turn off in File Handling & Clipboard: include SVG Code!

1 Like

Adobe has solved the above issue in the release of Ai 2015.3.1 (v.20.1.0) yesterday.

1 Like

Unfortunately this does not solve my problem with copying raster graphics in Illustrator while KMs engine is running.

JimmyHartington,
Did you ever find a solution for this?

I have not found a really good solution.
Other than toogle the KM Engine off when I need to copy a lot in Illustrator.

See this reply in the thread.

But the problem is mostly when copying image data in Illustrator and in most of my work I do not do that.

That is mostly my colleguages, which do this. And they do not use KM as most as I.