this post was submitted on 24 Jan 2024
10 points (100.0% liked)

macOS

909 readers
1 users here now

The home for all things macOS on LW.

Rules:

founded 1 year ago
MODERATORS
 

This is killing me.

We have a snippet of code on a web page. Users copy the code to a text editor, make a small change, then copy the modified version and paste it into a terminal window.

And it fails to run.

I've confirmed this happens with both Textedit and Notes, and also that copying from the web page and pasting directly into a terminal works fine (although without the necessary code changes).

It's something in the text editor copy; and there's no way to either "copy as plaintext" or "paste without formatting" into a terminal.

Does anyone know how I can work around this?

EDIT Apparently some (but not all) spaces (octal 040) are being converted to octal "302 240". I can't figure out how to stop it!

top 2 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 2 points 6 months ago

I don't know if this helps, but I saw/confirmed that if you edit plain text with text editor and try to open and execute Script Editor.app that it will compile and look ok, but not work. There is some sort of hidden metadata that are missing.

[โ€“] [email protected] 1 points 7 months ago

Doesn't shift+Ctrl+v paste the code as plan text?