Copying certain objects from Illustrator CC2015 is slow

Hi

I have a problem which on my system and those of my colleagues.
We are a graphic design company and use the Adobe Creative Cloud.
This current problem is in Illustrator.
When I copy a certain object, then Illustrator hangs for about 3 minuttes.
But if Keyboard Maestro is not running, then the copying happens instantly.

I have contacted Peter about this and he has been very helpful in trying to troubleshoot it.
We have tried to do the clipboard debugging but I ended up having all flavours checked before it works instantly.

I have also tried to examine the clipboard with this command in the script editor:

the clipboard as record

Then the script editor hangs. :frowning:

I hope somebody on this forum, which also have Illustrator CC2015 are willing to help me test is only on our systems or it is more common.
Here is an Illustrator-file which I have used to reproduce the problem: http://cl.ly/3r251v0W1b0k (external link due to sizelimit in the forum).
It consist of only one object.
To replicate the issue, then make sure the KM Engine is running. Open the Illustrator-file and copy the object. If it makes Illustrator hang, then I would like to hear about it.

I am running on OS X 10.11.3, MacBook Pro 17", 16 GB Ram, 500 GB SSD.
My colleagues are using OS X 10.10.5, iMac 27", 16 GB Ram, 256 GB SSD.

Thanks for your help.

Bump :slight_smile:

Hey Jimmy,

I don't have Illustrator to test with, but here are a couple of observations:

GraphicConverter reports the tiff alone takes 258.2 MB in Memory.

The Script Editor is not really designed to display so much data.

I tried copying the tiff using GraphicConverter and then running the clipboard as record in Script Debugger. Not surprisingly it hung.

So I tried writing to a file instead:

set filePath to (path to desktop as text) & "clipboardData.dat"
writeFile((the clipboard as record), filePath, 0, record)

on writeFile(srcData, targetFile, startPosition, dataType)
  try
    set fileRef to open for access targetFile with write permission
    if startPosition = 0 then
      set eof of fileRef to 0
    end if
    write srcData to fileRef as dataType starting at startPosition
    close access fileRef
  on error errMsg number errNum
    try
      close access fileRef
    end try
    error "Error in handler: writeFile of library: gen.lib" & return & return & errMsg
  end try
end writeFile

It hung Script Debugger for quite a while, but after about 4 minutes or so I got a file. A 1.05 GB file.

So. I'm not shocked that you're having problems.

Unfortunately I don't have any ideas for sorting them out.

-Chris

Hi Chris

Yes, this is a big file.
But if I quit the Keyboard Maestro Engine then there is no delay.
I think Illustrator does not export the clipboard to the OS. Because when I quit Illustrator it ask me if I want to export the clipboard.

So maybe when KM is running it snatches the clipboard even though Illustrator it self has not released it.

Do you know if there is a way to exclude a program from the clipboard switcher?
Maybe a defaults command or something?

No, there is currently no way to exclude an application from the clipboard history.

You can exclude specific flavors, but your tests indicate that that does not help.

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....