hey guys, im savein some .txt files on the mac an openin them on a pc, an they open weird on the pc, without the line breaks
is there a settin in texteditor so windows can see it like i see it on the mac?
Xcode, TextWrangler and other advanced text editors can change the line endings...
More example of the limited functionality of notepad. Other editors can do it easily.
i ment to say , why cant osx save it the windows way
Because it's not Windows. Linux does it a different way from Windows and Mac. When on a Mac, it only makes sense a program would save it in a Mac format. I use text editors that let me choose line endings and encoding types (BBEdit). TextEdit and Notepad are just too basic for me as a developer.
Linux does it a different way from Windows and Mac.
i ment to say , why cant osx save it the windows way
For Mac OS 9 and below, this is true. For Mac OS X and newer, however, it is not; like most other Unix-like systems it uses the '\n' character as the newline. Microsoft apparently couldn't decide which one was better and implemented both :/
Mac OS 9: \CR (\r)
Mac OS X, Linux, *BSD, etc: \LF (\n)
Windows: \CR\LF (\r\n)
tell application "TextEdit"
set output to ""
repeat with n from 1 to number of paragraphs of document 1
set output to output & (paragraph n of document 1) & (ASCII character 13) & (ASCII character 14)
end repeat
make new document with properties {text:output}
end tell
What if I'm creating text files to be seen by others? ... who might likely be on a PC and might double-click to open?
So I want a solution that works for that case.
Should I save the files as .rtf, will that work? Or would a more reliable solution be to make .html pages of them? Or ... ?
Please read over the thread more closely as it already answers your questions. If you feel it doesn't, you may want to explain what further explanation you're needing.
For now, I want to use TextEdit and no scripting and achieve the desired effect (line breaks show as entered) on various (Windows and other) systems.
The only solutions to this I know are (1) to use .rtf or (2) to make .html files and put in my <br>s where wanted. So my question is will TextEdit's .rtf be reliable enough for double-clicking over various (Windows and other) systems? or would I best make the files .html? Or am I still missing something in the thread?
(In the future, I will probably try BBEdit or one of the other text editors, preferably just one of them ... )
(In the future, I will probably try BBEdit or one of the other text editors, preferably just one of them ... )