15

I want to edit Info.plist for TextEdit. (Here's why.) I'm running OS 10.7, and I do have Xcode installed. But every time I try to edit the file, it's locked and I can't save my changes.

If I try to save it with Xcode, Xcode asks if I want to unlock it. I say "Unlock", but then an error says The file "Info.plist" could not be unlocked."; it says that this is because I do not own it.

If I open Info.plist using vi in Terminal (vi Info.plist), I can't save changes even using :w!. The error is E212: Can't open file for writing.

How can I make changes to TextEdit's Info.plist file?

10

Before you do this make sure there are no running instances of TextEdit on your system.

Using The Finder

Select the plist file in the Finder and doing File > Get Info. At the bottom of the file info window you'll see a section called Sharing & Permissions. You want to make sure you're in that list and that you have Read & Write level access to the file.

Finder Info Dialog

Before you can add yourself to the access permissions on the file though, you'll need to unlock it. Click the little lock icon (1) in the lower right hand corner and enter your password. If you're not an administrator on the machine, you won't be able to proceed past this step.

Once you've unlocked the file you can change your permissions to Read & Write. If you're not shown in the list of people who can access the file, click the + button below the list and find yourself in the Users & Groups list that pops up.

The changes are applied to the file as soon as you make them in the File Info window.

You should now be able to open, edit and save those edits to the file.

Using The Command Line

Open a Terminal window.

Change to the place where the plist file is located:

cd ~/Library/Preferences/

Change the ownership and permissions on the file so you can read and write it:

sudo chown $USER aomDSP.plist
sudo chmod u+w aomDSP.plist

You probably don't need sudo on the second call there, but it can't hurt. You'll need administrator access to the machine to do this.

  • 1
    The "Finder" instructions worked for me - thanks! – KatieK Oct 16 '12 at 20:38
  • TextEdit and other applications that use auto-save also need write permissions to the directory the file is in. – Lri Oct 17 '12 at 10:25
  • 2
    The finder instructions didn't work for me - when I went to add a user or to edit permissions for everyone, it said "The operation can't be completed because you do not have the necessary permissions". My account is admin. The command line chown also said operation not permitted. – jzadra Nov 21 '18 at 22:26
  • @jzadra that it's greyed out would suggest the account you're trying this from does not have administrator privileges. – Ian C. Nov 23 '18 at 21:20
  • But....I am admin. I'm looking at it in the settings and it says "Admin". And there's no other accounts. Any suggestions? – temporary_user_name Jan 19 at 1:32
2

If you want to edit the file (as you describe above), you don't necessarily have to unlock it. If you're fine with working on the command line, you may edit the file using the command line tools provided by Apple. Prepend the commands with sudo to gain the required rights to modify the file (you will need to enter your admin password).

Namely these programs are defaults and PlistBuddy (run as sudo /usr/libexec/PlistBuddy). While defaults is a more direct way of modifying the file, PlistBuddy has an interactive mode wich lets you preview your changes before saving.

Documentation for defaults

Documentation for PlistBuddy

If required, you can also use plutil to convert between the different formats.

Remember that you can get help about all of these commands on the command line by typing man <command> (e.g. man defaults).

  • In my case, the file I wanted to edit was opened by my editor (xcode), so this was the only way to get this to work. Thank you. – Sean Vikoren May 15 '18 at 19:40
1

It did not work for me allowing the edit by unlocking the file. I had to duplicate it, edit and then remove the original file. Now I have my own default font.

0

Put in on the desktop, then you can change it, then put it back in the folder where it was before (tested on mac mojave 10.14.6)

-2

The system does not allow for removal or replacement of the .plist file.

  • That's not necessarily true. Please provide documentation in support of your statement. – fsb Oct 5 '16 at 20:43

You must log in to answer this question.

protected by Community Sep 28 '17 at 18:50

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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