11

As an academic, I often have to conduct "numerical experiments" by running a small computer program that outputs to a text file. I use TextEdit to read the text file. However, when I re-run the program, and the contents of the text file changes, I find that the contents in TextEdit do not automatically update to the new version. In order to access the new version, I need to close the existing TextEdit window, and open the file again in TextEdit.

Is there a way to refresh the file to the new version in TextEdit? For those of you who know about the program Vim, what I am looking for is like the command :e[dit] in Vim which allows one to

Edit the current file. This is useful to re-edit the current file, when it has been changed outside of Vim.

2
  • I do not use TextEdit, but BBEdit will definitely update when edited elsewhere. Dec 27, 2013 at 4:39
  • 1
    Thank you for your comment. I decided to try TextWrangler (the free version of BBEdit) and it also auto-refreshes. Dec 27, 2013 at 19:49

2 Answers 2

9

There's a ugly way of doing it, as far as I know.

Once the file has been edited just try to save it. TextEdit will prompt you saying something like:

The document "Untitled.txt" couldn't be saved. Other application modified the file.

Giving you the choice to either Restore or Save anyway.

While Save anyway will keep your changes and save as a new version the changes made by the other application, Restore will update your file with these new changes.

Unless there's a specific reason to use TextEdit I'd recommend using any other text editor, such as TextMate, which supports the automatic refresh.

2
  • 3
    TextMate is a gem. Sep 12, 2016 at 1:10
  • In Macos ventura it is revert instead of restore. save anyway is an option and save as..
    – Timo
    Aug 9 at 5:51
-3

Refresh current open file is refresh by using ALT+F and R

1
  • Isn't that a Windows set of keys?
    – mmmmmm
    Jan 15, 2019 at 13:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .