Pages Repeats Previously Copied Text When Trying To Past Newly Copied Text

On macOS Sonoma 14.2.1, Pages 13.2, when copying and pasting text from Pages to Pages and other sources, the paste will sometimes keep repeating the previously copied text instead of the newly copied text. I cannot find a clipboard where I might be able to erase the repeating paste text.

Mac Studio

Posted on Mar 1, 2024 10:25 AM

Reply
Question marked as Top-ranking reply

Posted on Mar 3, 2024 10:07 AM

The following AppleScript will clear the current General and Find clipboard contents. See if this corrects your issue with clipboard.


In the Finder, click shift+cmd+U to open the Utilities folder and double-click the Script Editor application in it. When you have set the Script Editor dialog to your Desktop, click New Document, and on that empty panel, copy and paste the following AppleScript into it. Click the hammer icon to compile the script code, and then click the Run button. There will be no indication that anything has changed, but your two clipboard locations will now be empty.


use framework "Foundation"
use scripting additions

property NSPasteboard : a reference to current application's NSPasteboard
property NSPasteboardNameFind : a reference to current application's NSPasteboardNameFind
property NSPasteboardNameGeneral : a reference to current application's NSPasteboardNameGeneral

set pbArray to [NSPasteboardNameFind, NSPasteboardNameGeneral]
repeat with aPB in pbArray
	set pb to (NSPasteboard's pasteboardWithName:aPB)
	pb's clearContents()
end repeat
return


Tested: macOS Sonoma 14.3.1 and Pages v13.2

Similar questions

6 replies
Question marked as Top-ranking reply

Mar 3, 2024 10:07 AM in response to ralphjs

The following AppleScript will clear the current General and Find clipboard contents. See if this corrects your issue with clipboard.


In the Finder, click shift+cmd+U to open the Utilities folder and double-click the Script Editor application in it. When you have set the Script Editor dialog to your Desktop, click New Document, and on that empty panel, copy and paste the following AppleScript into it. Click the hammer icon to compile the script code, and then click the Run button. There will be no indication that anything has changed, but your two clipboard locations will now be empty.


use framework "Foundation"
use scripting additions

property NSPasteboard : a reference to current application's NSPasteboard
property NSPasteboardNameFind : a reference to current application's NSPasteboardNameFind
property NSPasteboardNameGeneral : a reference to current application's NSPasteboardNameGeneral

set pbArray to [NSPasteboardNameFind, NSPasteboardNameGeneral]
repeat with aPB in pbArray
	set pb to (NSPasteboard's pasteboardWithName:aPB)
	pb's clearContents()
end repeat
return


Tested: macOS Sonoma 14.3.1 and Pages v13.2

Apr 1, 2024 2:18 PM in response to ralphjs

To: VikingOSX:  Thank you for your continuing assistance.  In some error, your latest message does not appear here.  It is as follows:  “I reread your initial post and it sounds to me that you are not replenishing the clipboard with different content. Pages will continue to paste what is on the current clipboard ad nauseum until that content is replaced with updated content from a subsequent copy of selected text.”



This is exactly how I expect copy and paste to work.  From doing the previous one, I proceed directly to selecting (highlighting) new text and use Command + c or copy from the menu and trying to paste in the same way.  Often this does not work, sometimes within the same document, from Pages to Pages documents, and especially copying from Books to Pages, per my originally indicated issue.  



I have now found out what the problem is!  When I select new text to copy, this does not always clear the previous selection (and hidden clipboard) as indicated by highlight remaining on the previously copied text.  It requires a double click and at times a third in an open space to clear the previous selection highlight.  Having to clear the previous selection is further troublesome because there is little open space to do this, often resulting in highlighting unintended text or causing an unwanted page turn.



I am writing a research book which requires extensive quotations and footnote (endnote) attributions.  As mentioned, I have opted to use Pages because Word has become so difficult to use with overladen options.  Although this happens very rarely within Pages documents, the frequent problem from Books to Pages appears to be oversight or coding error in Books.  Of course, my needs would not affect someone doing typical reading.



I’ll also throw in that I’m having frequent difficulty tapping the desired text on an iPad Air OS 17.4.1.  I don’t know, but this seems to me a hardware more than a software issue.  I don’t have problems with tapping for page turns.



Although it is unlikely, I’m posting this in case anyone has the same problem.  I have spoken with Apple specialists in these apps, who have not previously heard of the problem, but I will relate it to them and hope for a fix.



I forgot to mention that when this problem occurs from Books to Pages, I’m first transferring notes, etc. from iPad Air OS 17.4.1, Books 6.3 (6040) with handoff sync to Books on a Mac Studio OS Sonoma 14.4.1, and copying and pasting from there into Pages 13.2 (7038.0.87) where my research work is being written.  



Finally, I do not have this problem with copying from Kindle to Pages.

Mar 6, 2024 4:55 AM in response to ralphjs

When I launch Apple's Script Editor



it presents as a File Chooser dialog. For this exercise, just click the New Document button on the bottom of that File Chooser. That will open the Script Editor to a blank screen. Once you copy and paste the above code into it, and click the hammer icon, it looks like this:



It looks no differently after you click the Run button as there is no output from clearing the two clipboards.


My Script Editor has never launched as "locked" and it will work as written providing you are using this on macOS 10.10 or later.


This code was simply a test to see if your clipboard issues disappeared afterward. I am a fellow user and neither Apple, nor Apple product teams participate in these user-supported public communities. Each application designer determines what content it will place on the clipboard and what content that application will read from the clipboard. MS Word may place certain styling information on the clipboard that Pages, not being a Word clone, is not designed to handle properly. There is nothing for Apple to fix if you were hoping that Apple would make Pages a Word clone… 😉


You do not have to use MS Office, and my Office 2021 for Mac home and business cost around $30USD from StackSocial. So high cost should not be in the equation. All software is becoming top heavy with features that most of us won't use, but this is not the place to bemoan that issue.


You can trial Softmaker's Office 2024 for Mac which opens Word, Excel, and Powerpoint documents in their native Microsoft document formats. There is also the free LibreOffice Suite which is purposely and continuously updated to be a Microsoft Office clone and has thorough documentation support.

Mar 5, 2024 2:46 PM in response to VikingOSX

First, let me apologize for the typo “PAST” which should be “PASTE”.


I appreciate that your directions appear clear and complete; however, I could not get this to work. When I open the Script Editor it says “Locked”. I was not able to find “Foundation”. Instead, I find 2 windows with the upper under “AppleScript” which is filled with extensive code. The bottom window says “Description”. When I fill your code into the “Description” window and click the hammer I get “Syntax Error - A unknown token can’t go here”. I’m probably in the wrong place anyway. I greatly appreciate your detail, and apologize for not being able to execute it. I do have the question of whether this procedure would be necessary whenever I repeatedly have the problem, which would be impractical. Also, I don’t understand why Apple cannot correct the error without forcing users into an elaborate procedure. Also, why doesn’t Apple provide direct access to the clipboard, which you indicate exists though it seems to be hidden. Further, I fully understand that there will be the wide critique that I should be using Word anyway, which I have previously done. However, I find Word's continual addition and moving of controls to make it so overladen that it has become difficult to use. Perhaps I’m not keeping up, but more doesn’t always mean better. Also, I do not appreciate the high, climbing and recurrent cost of Word. If you stop paying, Word documents are read only, though I’ve generally had success copying them to Pages. I know this is so long no one will read it, but I’m not a happy customer of either company.

Mar 8, 2024 1:30 PM in response to ralphjs

Thank you for the further directions, which I am fairly confident have been executed. You have gone to considerable time and trouble to help, and I greatly appreciate it. Unfortunately, this “test” has not resolved the problem. Of course, you are trying to find a workaround for an Apple error that needs to be fixed.


Since you mention it, I specifically do not want Pages to be a Word clone - just the opposite. I’m using Pages because of it’s relative simplicity, though I take your point that this may not be the place to “bemoan” the ongoing layer upon layer of software features that make programs such as Word harder and harder to use. We are not here to marvel and figure out what coders can do, we need to get work done.


Why are companies so insulated and arrogant as to not understand that they are making their products less desirable and useful? I greatly appreciate your passing along alternatives, which I am now forced to try, but I can’t help mentioning that this obviously proves the point. I will have to spend valuable time learning another app. I shouldn’t ask you for more, but if you wish, I would be grateful for knowing the proper places to voice these complaints, as I shouldn’t but can’t help expressing my frustration here.


Thank you for spending your valuable time helping me.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Pages Repeats Previously Copied Text When Trying To Past Newly Copied Text

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.