MATLAB Answers

9

2018a Copy Paste not working Live Scripts

Asked by Abhishek Varghese on 11 Apr 2018
Latest activity Commented on by victor bic on 20 Aug 2019
Hello, I receive this error message every time I press 'Ctrl+C' in a live script.
Apr 11, 2018 6:18:12 PM com.mathworks.connector.message_service.impl.MessageServiceJSONImpl handlePublishRequest
WARNING: Error in subscription handler
java.lang.IllegalArgumentException: C:\Users\Abhishek\AppData\Local\Temp\ConnectorClipboard2848936797537281347 does not exist
at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1637)
at com.mathworks.services.clipboardservice.ConnectorClipboardService$4.handle(ConnectorClipboardService.java:319)
at com.mathworks.connector.message_service.impl.MessageServiceJSONImpl.handlePublishRequest(MessageServiceJSONImpl.java:29)
at com.mathworks.connector.message_service.impl.AbstractMessageService.handlePublishRequest(AbstractMessageService.java:58)
at com.mathworks.connector.message_service.impl.JniMessageServiceAdaptorImpl.doHandlePublish(JniMessageServiceAdaptorImpl.java:59)
at com.mathworks.connector.message_service.api.JniMessageServiceAdaptor.fromNative(JniMessageServiceAdaptor.java:21)
What do I do? How do I fix this?

  2 Comments

I found the simplest way to do that. Select the text, CTRL + X, to copy and cut, then, CTRL + Z to return the cutted text, and thats it, the text in live script is copy.
Thank you. It was so anoying having to restart Matlab just so I can copy paste.

Sign in to comment.

Tags

5 Answers

Answer by Adri van Nieuwkerk on 13 Apr 2018
Edited by Walter Roberson
on 7 May 2018
 Accepted Answer

Hi there Abhi,
I've had the exact same problem. The Official MathWorks Answer: The potential cause for this issue is related to the Windows SilentCleanup Task. This issue is explained in detail at the following Microsoft Support page:
It may be temporarily resolved by restarting MATLAB. If not try out the following steps to test a possible workaround for this issue:
  • Start a command prompt as an administrator.
  • Please disable the SilentCleanup by executing the following command in the command prompt window:
schtasks.exe /change /TN \Microsoft\Windows\DiskCleanup\SilentCleanup/Disable
  • You can always enable it again later with:
schtasks.exe /change /TN \Microsoft\Windows\DiskCleanup\SilentCleanup/Enable
The Windows Build 1709 introduced some new functionality, which removes all empty folders in the TEMP directory. This could be the cause of the copy and paste error.

  2 Comments

Is there a solution when there is no admin rights? Admin rights might be a problem for corporate Matlab users...
Thank you very much. I have the same issue and it's fixed now.

Sign in to comment.


Answer by Ralph Gnauck on 7 May 2018

A possible workaround is using drag and drop, this still seems to work in the live editor.
Example:
Highlight the text in he live editor. Hold the Ctrl Key and Click and drag the highlighted text to where you want to paste it. Can be in same window or another window on the screen.

  1 Comment

Cool. You can always drag and drop the text to Command Window and then you can copy it.

Sign in to comment.


Answer by Elias Hasle on 5 Oct 2018
Edited by Elias Hasle on 5 Oct 2018

I tried the double drag and drop solution for a while, but it becomes very cumbersome when editing formulas etc. I did not want to disable Windows functionality because of a silly Matlab bug. So I found another solution:
Try to copy something, then in the error message read which folder is missing. Make a new folder in Temp with that name, and put a dummy file in it, so that it does not get deleted. Now copying works for the current Matlab session. It even worked after a restart of Matlab with the same script, at least for the time being.
Files in Temp tend to be temporary, so this procedure probably has to be repeated now and then, maybe after reboot or after changing active working directory or something. But it is better than not having copy/paste. And frankly better than spending hours upgrading Matlab too (if there is even a fix in the newest version)...

  1 Comment

This solution seems to work for me! Thanks!

Sign in to comment.


Answer by Kouichi
on 11 May 2018

I'm also experiencing the same issue with exactly the same error message.
And it's related to a folder in Temp, so SilentCleanup Task's involvement makes sense!
>schtasks.exe /change /TN "\Microsoft\Windows\DiskCleanup\SilentCleanup" /Disable
ended up with an error:
'schtasks.exe' is not recognized as an internal or external command,
operable program or batch file.

  0 Comments

Sign in to comment.


Answer by Davide Cerra on 26 Jun 2019

Simply drag with your mouse

  1 Comment

Worked well!
tks!

Sign in to comment.