paste is disabled in the app designer

Does anybody else find that "Paste" (as in clipboard copy and paste) is disabled when editing code in the "App Designer". I have no issues at all with pasting with the regular Matlab editor; only when using the App Designer. If I use Ctrl-V, nothing happens and if I right click with the mouse, "Paste" is greyed out.
I did some searching and see where some have had this issue with the regular editor 3 or 4 years ago and their solution was to reboot. I've tried that with no luck. Windows 7, 64 Bit. Matlab 2016B Thanks in advance! S

8 Comments

I understand that you are not able to "Paste" in the AppDesigner script. Clipboard options are disabled for Matlab generated part of the code, because it stores all the property of your App layout. You can add a new Callback, Function or a Property and you will see the paste option again.
From the app designer: Go to code view> add a callback> you can paste your text
Hope that helps.
Sudarshan... Even in the editable section, for some reason Paste does not work, do you know how to get around that? it almost seems like there is Preference setting to disable Paste!
Michal Dobai
Michal Dobai on 13 Dec 2017
Edited: Michal Dobai on 13 Dec 2017
Hmm.. That sounds odd. Even if you create new project? Or it's a project-related thing? I've been working with app designer quite a lot lately and I have to say I noticed some strange, unexpected behavior several times. Not this particular one, though. But for me restart always worked just fine.
KJ N
KJ N on 20 May 2018
Edited: KJ N on 20 May 2018
I am getting the same error (not being able to Paste). I can right click or Ctrl-C to copy from within a script or from the folder path and then paste into another program (website, Word, etc.) but I cannot paste into the Script Editor with either Ctrl-V or by right-clicking. I can edit the script contents as well as "click and drag" sections of text. Restarting the program fixed the issue, but it does appear to be a random bug. (2018a on Windows 10.)
This issue still happens to me with 2020a as well. The fix I use:
Type something into the main Command Window, then drag it (not copy/paste) onto the App Designer.
This returns my ability to use paste in the App Designer.
that does not seem to be a proper fix, plus it does not really work for me. I did not have this issue with R2020b but it is present in R2021a. CTRL-V works in my case but not CTRL-C
Hello,
I am using R2020a version and experienced the same behaviour - I could not copy and paste in code view of Appdesigner. For me worked restarting Matlab and it worked fine.
I have the same problem. Using R2021b in Windows 10. Somehow copy/paste becomes disabled in app designer code view editing and paste does not appear as an option in the dropdown. I tried copy/pasting into a word file, then back, using keyboard shortcuts, and a few other things that didd not work. Finally, I tried saving what I needed to, quitting matlab, then restarting it. That worked, so far. If it returns during this work session, I will update this comment.

Sign in to comment.

Answers (7)

Aravind C G
Aravind C G on 11 Mar 2019
Edited: Aravind C G on 24 Mar 2019
The fix that worked for me:
1) Return to design view. Copy paste a random element. Delete it.
2) Go back to code view. Try copy pasting. It should work.
EDIT: This bug happened to me once again, don't know the cause. But the above fix no longer worked. (March 23,2019)
Things that didn't work:
Just closing and reopening the same file in app designer
Restarting App Designer only (not restarting matlab) and then opening up the file again.
Possible Cause:
I think there is some issue with how App Designer switches between the two clipboards (that Melissa mentions below) when you change views. Will update this answer if I find the steps to reproduce the issue.
Hi Scott,
App Designer has two different clipboards, one for actions completed in the design area and one for text edits. If you are finding the paste buttons disabled when you want to paste in the text editor, try using the keyboard shortcut ctrl+v. However, this shouldn't be necessary because the paste buttons are for the editor in code view and the design area in design view. Please let me know if this issue persists and if so, what version of MATLAB you are using.
-Melissa

11 Comments

Hi Melissa,
I have the same issue. using ctrl c+ctrl v only leaves a string "c" or "v" in the cell. Someone suggest adding a callback in UItableedit, but that still does not work. Is there a good solution? I'm using Matlab 2017a.
Tianyi
I have the same issue. Only paste shortcut is not working in matlab R2017a.How to solve?
Ditto. I found this bug when I'm trying to cut and paste code (my code) from one function callback to another. Neither the shortcuts nor the context menus options work for me :(. I'm in Windows 10 using 18a.
Also have this issue on Windows 10, 18a
any updates on this?
I have also this problem, has anybody solved this ?!
I have created a bug report to see if this can be reproduced and we can offer some workarounds. This seems like it's only happening to a few folks, so it might be environmental.
This is happening to me too, cannot paste into the main section
Raúl Díaz
Raúl Díaz on 2 Sep 2019
Edited: Raúl Díaz on 2 Sep 2019
Still happening... nothing from above works (MATLAB 2018a & Windows 10)
Same Problem Win10, Matlabversion 2019b,
This issue still happens to me with 2020a as well. The fix I use:
Type something into the main Command Window, then drag it (not copy/paste) onto the App Designer.

Sign in to comment.

Hi everyone,
If you are experiencing issues pasting, could you contact MATLAB tech support and let us know what OS and version of MATLAB and also if this is in the regular editor, editing a Live Script or in App Designer. Also if it's all the time or only after certain actions. Those details will help us narrow down why this happens sometimes and help offer suggestions.

10 Comments

I'm using Windows 7, MATLAB 2018A. This happens intermittently when trying to paste code in the App Designer Code View. I haven't been able to narrow down the pattern for why it works sometimes and not others
This started happening around the time I upgraded to 2018b (windows 10). This only affects app designer.
Earlier today I could not paste, hence the post above. Subsequent to the post, I happened to open a new app designer project and noticed I could paste into that. I then double checked my existing projects (started in 2018a) and paste now seems to work on both new and existing projects.
I appreciate I am not following the instruction to contact tech support, however it does seem to be fixed...hope this helps.
After experiencing this issue on Windows 10 in the Matlab R2018a App Designer Code View, copy/paste functionality was restored after closing and reopening Matlab.
Same issue happened in 2019a App Designer after copy and paste a component in design view.
Feb 2020, still can't seem to copy/paste with any type of command. Using a Mac OSX 10.15.3. Catalina. Very frustrating and it does not seem to matter which browser is used. Rebooted the laptop, killed the pboard in the apps and nothing. So, the common demominator is MatLab.
I have the same issue here, March 2020 using Windows 10. Extremely irritating. I never realized how much of my workflow depends on copy/paste, but it's really slowing me down. Has Mathworks found a solution for this problem yet??
Mine works for a period then stops working using mouse or hotkeys, restart of the App Designer interface fixes it.
I have the same problem. it usually happens after calling matlab from Python and running my model.
then copy/paste will never work unless I restart the Windows.
It is really frustrating. Did you manage to find the solution?
It happens to me with Live Scripts.
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.9.0.1467703 (R2020b)
MATLAB License Number: 249102
Operating System: Microsoft Windows 10 Enterprise Version 10.0 (Build 18363)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
I've tried right-clicking to bring up the context menu, and "paste" is disabled (grayed out), so the Live Editor clearly doesn't think that there's anything in the clipboard. I can switch to a regular .m file in the editor and paste the text I copied from the Live Editor, so it appears that "copy" is working.
I haven't yet found the trigger nor a reliable fix. I've had the same problem on a different Windows system with R2019a, but not on yet another Windows PC with R2017b.
Same issue on Windows 10 in the Matlab R2019b

Sign in to comment.

I have faced the same problem in MATLAB 2020b.
I have tried to drag and drop the selected section of code I want to paste in Code View as below.
It was an alternative solution for me!
I have a work-around:
In my case (R2020b) copying works, but not paste. Also, moving by dragging works.
  • I copy from the code view.
  • I paste into the regular editor.
  • I drag from the regular editor into code view.
hi, copy & paste works in R2021a but the problem is that when your code is long it takes literally crazy long for paste (10 or 20 sec) to execute. To make matters worse, once you trigger "paste", you can still type code and then your paste will be done whereever you are currently editing.
I was at my wits end with the problem that control-V wouldn't insert my text, and in the right-click context menu, "insert" was greyed out. Restarting App Designer and restarting Matlab didn't help. I was trying to insert text at the end of a callback function by placing the cursor before the "end" statement of that function and then using control-V. It turns out that the "end" statement of a callback function is not editable. Although the background of that line is slightly greyed, it wasn't enough for me to notice it. This explains why most items on the right-click context menu were greyed out. Once I realized that, I inserted my text instead at the end of the previous line.

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products

Asked:

on 23 Feb 2017

Answered:

on 5 May 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!