DISQUS

Tech-Recipes: OS X: Edit a file using TextEdit as root or superuser | Mac system administration | Tech-Recipes

  • mori · 1 year ago
    I get this error trying this hint:

    2008-12-02 22:13:54.216 TextEdit[1144:c17] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x4403, name = 'com.apple.TextEdit.ServiceProvider'
    See /usr/include/servers/bootstrap_defs.h for the error codes.
  • davak · 1 year ago
    I get that error sometimes too. It shows up in the terminal after textedit is loaded. It still works fine though.
  • Hank Z · 6 months ago
    Does this still work under Leopard???????

    I enter

    sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts

    Then my password and Text Edit does not open the HOSTS file.

    Is something Wrong
  • Gerry · 6 months ago
    make sure ur password isn't blank. Mine was and I had the same problem. But once I changed my password to sth else, it works perfectly.
  • alexkeil · 3 months ago
    Very useful. I implemented this in my login shell so that I can call it with "textedit"
    Steps:

    1: open ~/.profile in textedit with terminal command "open -t .profile"
    2: insert the line "export PATH="$PATH:/Applications/TextEdit.app/Contents/MacOS/"
    along with a commented (#) note why I was doing this
    3: save that text file and close down terminal
    4: open a new terminal window, enter "echo $PATH" to ensure that this new entry showed up somewhere in the path.
    5: I can now use textedit as a superuser with "sudo textedit"

    It saves about a few keystrokes in the long run if you like to edit previously uneditable files (but be careful!). Always save a backup of the file you are editing with the command:
    "cp foo.txt foo.backup"
  • Kyle Palaniuk · 3 weeks ago
    Great explanation. I usually don't write comments like this but really, nice job. Probably the most clear explanation you can get, and I successfully blocked what I had hoped to. Thanks!