Need ways to copy text in textedit file

Hello community! This is my first question! I have an extremely long piece of code I need to copy, but I can't copy the actual file. I need to copy the text in the file instead. I tried to press Command+A to highlight all of the document at once and then copy&paste it into ChatGPT, so I could get some help. This didn't work out, as when I tried to copy it, Text Edit stopped responding, it wouldn't copy, and so it wouldn't work. Is there something I can do? I can't manually go through and copy & paste smaller chinks at a time; that would take just too much of my time.


Any help is appreciated!


AppleLover2028

Posted on Aug 31, 2023 2:31 AM

Reply
2 replies
6 replies

Aug 31, 2023 4:10 PM in response to VikingOSX

The code is written in C++ and is also written in Clausewitz. I don’t think I have enough description on what I was trying to do. I am trying to copy and paste lots of code, like I said, but I probably should have mentioned that I’m using it to get help in my game from chatGPT. I’m not editing it or anything. I just need to copy & paste extremely long amounts of code at once, specifically c++ and paradox Interactive’s engine, Clausewitz.

Aug 31, 2023 4:15 PM in response to AppleLover2028

Drag the text to the desktop and copy it from there. Alternatively, choose Utilities from the Finder's Go menu, open the Script Editor, and run:


set theOffset to 1

set the clipboard to ""

repeat

tell application "TextEdit"

try

set the clipboard to (the clipboard) & items theOffset thru (theOffset + 5000) of (get text of document 1)

on error

set the clipboard to (the clipboard) & items theOffset thru -1 of (get text of document 1)

exit repeat

end try

set theOffset to theOffset + 5000

end tell

end repeat


(243888)

Need ways to copy text in textedit file

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