Ask Different (Apple)
Q&A for power users of Apple hardware and software
Latest Questions
1
votes
2
answers
38
views
Automating multiple global replace in TextEdit?
For language learning, I frequently copy text from a website, paste into TextEdit, and do more than a dozen formatting changes.  Several of these are the same for all languages, so I save the file, do those changes with perl in a script, then open it again for manual edits. **If possible, is th...
For language learning, I frequently copy text from a website, paste into TextEdit, and do more than a dozen formatting changes. Several of these are the same for all languages, so I save the file, do those changes with perl in a script, then open it again for manual edits.
**If possible, is there a way to run a script on the contents of a TextEdit window?**
A partial (awkward) solution is to save the file without closing the window, in Terminal, run the script and
cat
the result, then the TextEdit window, Cmnd-A and paste the result into to replace.
WGroleau
(5370 rep)
Jul 3, 2025, 03:17 PM
• Last activity: Jul 4, 2025, 04:05 AM
3
votes
1
answers
324
views
TextEdit not responding after zooming in
Recently, i noticed TextEdit on macos bigsur(M1 chip) taking more than 3GB ram and is not responding after I try zooming in. Even though my .txt wasn't very big(just 4KB, barely 50 lines of text). Anyone experiencing the same, please respond? Is that a bug ?[![enter image description here][1]][1] Th...
Recently, i noticed TextEdit on macos bigsur(M1 chip) taking more than 3GB ram and is not responding after I try zooming in.
Even though my .txt wasn't very big(just 4KB, barely 50 lines of text). Anyone experiencing the same, please respond? Is that a bug ?
The ram consumption is increasing exponentially unless I force quit the app. Its working absolutely fine if I don't zoom into it.
Edit : It happens with any text file with TextEdit which is a bit large, e.g more than 50-60 lines. For .txt files with lesser content, its not happening.

Mohit Agarwala
(31 rep)
May 8, 2021, 05:47 AM
• Last activity: May 29, 2025, 01:10 AM
1
votes
2
answers
113
views
Automator: Error when running a Word Count service in TextEdit
I followed a brief [step-by-step guide](https://www.macworld.com/article/672819/) for adding **word count** functionality to **TextEdit**. Note that the guide instructs: "It will ask you to choose a type for your document; click **Service**". However, probably due to version differences, instead one...
I followed a brief [step-by-step guide](https://www.macworld.com/article/672819/) for adding **word count** functionality to **TextEdit**.
Note that the guide instructs: "It will ask you to choose a type for your document; click **Service**". However, probably due to version differences, instead one must choose **Quick Action**.
As the guide advises, I used this code:
osascript tell application “TextEdit” set word_count to count words of document 1 set char_count to count characters of document 1 set show_words to (word_count as string) & ” words. (” & (char_count as string) & ” characters.)” set dialog_title to “TextEdit Word Count” display dialog show_words with icon 1 with title dialog_title buttons {“Ok”} default button “Ok” end tell AppleScriptHereDoc
After creating the Action / Service and running it, I get the following error:
The action “Run Shell Script” encountered an error: “-: -c: line 0: syntax error near unexpected token `('
-: -c: line 0: `osascript tell application “TextEdit” set word_count to count words of document 1 set char_count to count characters of document 1 set show_words to (word_count as string) & ” words. (” & (char_count as string) & ” characters.)” set dialog_title to “TextEdit Word Count” display dialog show_words with icon 1 with title dialog_title buttons {“Ok”} default button “Ok” end tell AppleScriptHereDoc'”
The guide is from Feb 23, 2018 (over 5 years ago at the time of this writing), so that may have something to do with it. Hopefully there's a simple fix though.



Mentalist
(1360 rep)
May 1, 2023, 05:15 AM
• Last activity: May 24, 2025, 07:55 PM
34
votes
3
answers
77198
views
How can one save a file as plain text in TextEdit?
I'm not seeing an option to choose plain text encoding (.TXT extension) when saving a file in TextEdit.app in macOS. My documents seem to all be rtf - rich text format. How can I change this?
I'm not seeing an option to choose plain text encoding (.TXT extension) when saving a file in TextEdit.app in macOS. My documents seem to all be rtf - rich text format.
How can I change this?
nylypej
(970 rep)
Nov 11, 2018, 04:32 PM
• Last activity: May 9, 2025, 12:59 PM
9
votes
2
answers
1134
views
macOS TextEdit misbehaving after opening a binary mp4 file
Using Sequoia, I loaded an MP4 into textEdit because I was trying to find out if it had shellcode in it, and it has jammed up TextEdit I have to force Quit it this app repeatedly when I try and open it now in order to use macOS. To try and fix this, I looked in ~Library/Containers & ~Library/Prefere...
Using Sequoia, I loaded an MP4 into textEdit because I was trying to find out if it had shellcode in it, and it has jammed up TextEdit
I have to force Quit it this app repeatedly when I try and open it now in order to use macOS.
To try and fix this, I looked in ~Library/Containers & ~Library/Preferences but there isn't anything I can find where it's keeping the files that are loading into TextEdit.
What can I do to fix this app short of reinstalling macOS. I’m not even sure a reinstall on top would fix this if this is due to my user settings remembering this file what was previously open.
Can I fix macOS and TextEdit hanging after this?
Finch
(93 rep)
May 5, 2025, 11:47 AM
• Last activity: May 5, 2025, 01:58 PM
6
votes
3
answers
1365
views
File with no extension will be opened by TextEdit by default. How do I change that?
File with no extension will be opened by TextEdit by default. For example, in terminal run `open ~/.ssh/known_hosts` will open TextEdit to edit `known_hosts` These files are normally just text file so I don't want to use TextEdit open them (e.g. I want to use BBEdit to open them) but because they ha...
File with no extension will be opened by TextEdit by default. For example, in terminal run
open ~/.ssh/known_hosts
will open TextEdit to edit known_hosts
These files are normally just text file so I don't want to use TextEdit open them (e.g. I want to use BBEdit to open them) but because they have no extension I can't find an each way to change the default app to open them in one shot. Change them one by one is not workable.
So is there any way to change them in one shot?
https://apple.stackexchange.com/questions/123833/replace-text-edit-as-the-default-text-editor does not work for me,
First, the highest two answers there said something like duti -s com.sublimetext.4 public.plain-text all
but as @Seamus said in his updated answer "The accepted answer may have been correct when it was written, but does not work for current (as of approximately Catalina vintage) systems because the UTI for a text file without a file extension is now apparently public.data". Besides I don't know how edit bbedit part, is it com.bbedit.13 (I use bbedit 13 or what else)?
Second, all the other 3rd-party apps are too old, at least 10 years old without any update.
Qiulang 邱朗
(879 rep)
Apr 26, 2023, 10:00 AM
• Last activity: Apr 22, 2025, 03:00 PM
0
votes
0
answers
11
views
Not opening last version of a synchronized file
I regularly notice following behavior when synchronizing files with client-server software, especially with .txt files. > 1. Mac computers A and B contain an up-to-date version `N` of a file `file.txt`. > 2. I edit the file on computer A, then synchronize its version `N+1` with the server. > 3. I sy...
I regularly notice following behavior when synchronizing files with client-server software, especially with .txt files.
> 1. Mac computers A and B contain an up-to-date version
N
of a file file.txt
.
> 2. I edit the file on computer A, then synchronize its version N+1
with the server.
> 3. I synchronize computer B with the server, so version N+1
of the file is downloaded.
> 4. I open file.txt
on computer B (using Command–Space bar to locate the file in Spotlight). However, it opens the version N
of the file before synchronization.
> 5. Closing this file and repeating step 4 now opens the correct version N+1
of the file.
The problem with this is that if you do not notice at step 4 that you're not seeing the last version of the file and start modifying, you create a conflict.
Is this behavior caused by Mac (Finder/TextEdit)? How to avoid it?
Karlo
(491 rep)
Mar 3, 2025, 03:23 PM
0
votes
0
answers
73
views
Text Edit Copy/Paste bug / malware? Terminal fix?
I've got an older air running Big Sur, updated as far as it'll go. When I copy/paste from or into Text Edit, maybe other programs as well but I've only noticed with Text Edit, the text I copy from or paste into it will contain errors, such as random quotation marks placed in the middle of a word. Th...
I've got an older air running Big Sur, updated as far as it'll go. When I copy/paste from or into Text Edit, maybe other programs as well but I've only noticed with Text Edit, the text I copy from or paste into it will contain errors, such as random quotation marks placed in the middle of a word. This doesn't seem to happen when I type in browser windows. I notice the problems often as I'm typing SSML and the mistakes end up being crazy things I would never mistype. I'm wondering if there is a way, maybe in Terminal, to reset or check the inconsistencies between what I'm typing and what is pasted in Text Edit? I would just use another editor but I'm not sure if it's happening system wide and I really like Text Edit.
Note: I don't think it's a particular key that's messed up, I think it's some kind of script causing patterns to arise such as "move the period from the sentence of every line containing an "x" 3 spaces to the left. I've checked keyboard shortcuts etc. Also I bought the laptop used, so particularly suspicious of malware.
Ronald
(9 rep)
Jan 3, 2025, 03:07 AM
• Last activity: Jan 3, 2025, 05:15 AM
3
votes
2
answers
405
views
How can I revert the redesigned strange-looking text cursor after a Sonoma upgrade?
An issue I noticed is that there is a funny cursor locator blinker when using TextEdit app in the new Sonoma MacOS version. [![Stupid New Apple Cursor in TextEdit][1]][1] It is now an orangey colour and slightly wider. Awful aesthetics. How do I change it all back the way it was??? [1]: https://i.ss...
An issue I noticed is that there is a funny cursor locator blinker when using TextEdit app in the new Sonoma MacOS version.
It is now an orangey colour and slightly wider. Awful aesthetics. How do I change it all back the way it was???

John
(31 rep)
May 18, 2024, 12:39 PM
• Last activity: Dec 12, 2024, 07:07 AM
0
votes
0
answers
25
views
How do I tell MacOS to open TextEdit app at certain X and Y coordinates using a plist variable?
I've been looking at plist variables while trying to set the position and size of a window when the editor is launched. But I'm failing to guess or find the name of plist key for this. I was following similar advice [here][1] but without success so far. defaults read $HOME/Library/Containers/com.app...
I've been looking at plist variables while trying to set the position and size of a window when the editor is launched. But I'm failing to guess or find the name of plist key for this.
I was following similar advice here but without success so far.
defaults read $HOME/Library/Containers/com.apple.TextEdit/Data/Library/Preferences/com.apple.TextEdit.plist HeightInChars
I'm not working with multiple monitors which I hope makes it easier.
okram
(101 rep)
Nov 13, 2024, 01:37 PM
• Last activity: Nov 13, 2024, 01:39 PM
1
votes
0
answers
26
views
how do you "SAVE AS"?
I am on Mac OS 12.4, I make a new file in textedit, I save it and give it a name... I slightly modify the contents-- and I want to keep the original, but have a variation.. I click File to choose "Save as"... AND THERE IS NO SAVE AS (anymore)! ... I click the name of the file at the top of the windo...
I am on Mac OS 12.4, I make a new file in textedit, I save it and give it a name...
I slightly modify the contents-- and I want to keep the original, but have a variation.. I click File to choose "Save as"... AND THERE IS NO SAVE AS (anymore)!
... I click the name of the file at the top of the window, thinking this will do what I want, but NO it just renames it.
So, WHERE did Apple put SAVE AS?
patrick
(537 rep)
Oct 29, 2024, 02:01 AM
1
votes
1
answers
114
views
Formatting from Word docs in TextEdit
When I open Word docs in TextEdit some formatting is lost, especially numbered lists, the numbers are simply not displayed. Is there some hidden preference? This is really annoying, because I have to open the files in Google Docs to check if there are numbers, and I really really don't want anything...
When I open Word docs in TextEdit some formatting is lost, especially numbered lists, the numbers are simply not displayed. Is there some hidden preference?
This is really annoying, because I have to open the files in Google Docs to check if there are numbers, and I really really don't want anything Microsoft on my Mac -.- Actually not even any other text editor if I can help it. Tried to google, but couldn't find anything.
janine
(13 rep)
Jan 17, 2014, 12:43 AM
• Last activity: Oct 18, 2024, 08:50 AM
5
votes
5
answers
11758
views
Default background color in Textedit
How do I set default background color in Textedit? `Preferences -> New Document -> Font` doesnt help. That black on white isn't too good in nights.
How do I set default background color in Textedit?
Preferences -> New Document -> Font
doesnt help.
That black on white isn't too good in nights.
Samat
(195 rep)
Oct 31, 2012, 07:24 PM
• Last activity: Aug 1, 2024, 06:10 PM
8
votes
3
answers
9488
views
Stop TextEdit from using iCloud save
Every time I save a TextEdit file 'SAVE' always goes to iCloud, even though I have been saving to another folder. Can I stop 'SAVE' from doing this? I run OS X 10.9.4
Every time I save a TextEdit file 'SAVE' always goes to iCloud, even though I have been saving to another folder. Can I stop 'SAVE' from doing this?
I run OS X 10.9.4
Neil
(111 rep)
Jan 5, 2014, 09:29 PM
• Last activity: Jul 3, 2024, 11:52 AM
0
votes
1
answers
95
views
Emoji shortcut changed
Since I updated to the new MacOS Sonoma when I am on YouTube and want to put in an emoji the function key with the round circles no longer works. It only brings up a very small square thing. I have to now touch that button twice for it to bring up the full emojis so I can select them. And sometimes...
Since I updated to the new MacOS Sonoma when I am on YouTube and want to put in an emoji the function key with the round circles no longer works. It only brings up a very small square thing. I have to now touch that button twice for it to bring up the full emojis so I can select them. And sometimes even that doesn't work.
How do I change this and why on earth would Apple think it is a good idea to have that tiny pathetic pop up box where you cannot see anything?

John
(31 rep)
May 18, 2024, 01:33 PM
• Last activity: May 20, 2024, 01:12 AM
32
votes
10
answers
79365
views
How to edit the /etc/hosts file with TextEdit?
When I open the file with TextEdit (I don't want (truly, I am not able) to use vim), it is seen as "locked", even if I modify the permissions of the file via the "Get Info" window. How can I modify the hosts file with TextEdit?
When I open the file with TextEdit (I don't want (truly, I am not able) to use vim), it is seen as "locked", even if I modify the permissions of the file via the "Get Info" window.
How can I modify the hosts file with TextEdit?
Colas
(3030 rep)
Mar 8, 2014, 12:47 PM
• Last activity: Apr 2, 2024, 04:55 PM
1
votes
1
answers
538
views
How do I make TextEdit open documents in a new window in Sonoma?
I've just got a new iMac, running Sonoma. My old iMac was running Catalina. When I open an .rtf document while another document is also open in TextEdit, it opens the second document in a new tab in the existing window, rather than in a new window like it did in Catalina. I'd prefer to open document...
I've just got a new iMac, running Sonoma. My old iMac was running Catalina.
When I open an .rtf document while another document is also open in TextEdit, it opens the second document in a new tab in the existing window, rather than in a new window like it did in Catalina. I'd prefer to open documents in a new window by default.
I can't see anything in the TextEdit menus or settings dialogue to control this. Is it possible to change this behaviour, or is this yet another feature Apple have taken away?
Colin
(13 rep)
Mar 27, 2024, 06:41 PM
• Last activity: Mar 29, 2024, 07:41 AM
1
votes
1
answers
72
views
TextEdit disables menu when selected text has different fonts/styles
Prior to Sonoma, when using TextEdit (virtually always editing rich text docs), I could select any text and add/remove a style to whatever styles were present in the text. For example, if I had a sentence: This is an example of **bold**, and I wanted to use *italics* for the whole sentence, I simply...
Prior to Sonoma, when using TextEdit (virtually always editing rich text docs), I could select any text and add/remove a style to whatever styles were present in the text. For example, if I had a sentence: This is an example of **bold**, and I wanted to use *italics* for the whole sentence, I simply selected the whole sentence and clicked the *I* button. Simple, and common to most editors.
In Sonoma, however, if I select the wole sentence, the menu options become gray/disabled. I am forced to first select the non-bold part, italicize it, then select the bold part, and italicize that. Since I edit docs extensively, this requires a LOT of extra time.
I've searched haven't found anyone else mentioning this change, so I'm wondering if it is specific to my machine? Or some setting I'm missing? Thanks in advance for any suggestions.
iMobyl
(13 rep)
Jan 13, 2024, 11:19 PM
• Last activity: Mar 26, 2024, 08:02 PM
2
votes
0
answers
245
views
Cannot set default file associations for .xml files
I'm on MacOS Ventura. I use it for work so MS Office is installed. No matter what I do, XML files seem to always want to open with MS Word. I want them to open with another app. I'm using TextEdit as an example here: I've done the standard `Right click > Open with > Choose TextEdit > "Always open wi...
I'm on MacOS Ventura. I use it for work so MS Office is installed.
No matter what I do, XML files seem to always want to open with MS Word. I want them to open with another app. I'm using TextEdit as an example here:
I've done the standard
Right click > Open with > Choose TextEdit > "Always open with"
method.
This opens the file with TextEdit this one time, but system-wide XML's remain associated to MS Word.

Rino Bino
(121 rep)
Feb 23, 2024, 09:56 PM
30
votes
6
answers
9651
views
How to permanently put TextEdit in the Open with... menu list?
I'm a developer and often dealing with unusual file types. If I want to open one of these files in TextEdit, I have to start it first and then open the file with it, or drag the file to the TextEdit icon. Is there a way to permanently put the TextEdit.app into the Open with... menu list no matter wh...
I'm a developer and often dealing with unusual file types. If I want to open one of these files in TextEdit, I have to start it first and then open the file with it, or drag the file to the TextEdit icon.
Is there a way to permanently put the TextEdit.app into the Open with... menu list no matter what file type I'm looking at?
Of course this procedure will be useful for whatever text editor you choose if TextEdit isn't your cup of tea.
DrummerB
(823 rep)
Aug 13, 2012, 05:39 PM
• Last activity: Jan 1, 2024, 05:43 AM
Showing page 1 of 20 total questions