Opening PHP File in Text Edit

I was opening a .php file in Lion using Text edit instead of my usual code editor. To my amazement it tried to open the file as a rtf file.


Then it told me the file was locked and then it automatically saved it as .rtf file and ended up corrupting the file and my php wasn't even reconizable.


To replace the file I grabed a backup and replaced the .php file and know never to open any .php files in text edit again.


The problem is that I was able edit php files in text edit in Snow Leopard without an corruption.


I do this type of editing very rarely. But I point this out to show the problems that this Lion has created with the automatic revisions.


That in addition to the lost of the Save As command leaves me somewhat hindered to use text edit as the basic editor of anything.


• htaccess files

• css

• html

• php


I'd love somehelp if anyone can tell me how to stop text edit from coverting files?

iMac, Mac OS X (10.7.1)

Posted on Oct 28, 2011 8:38 PM

Reply
7 replies

Oct 28, 2011 9:01 PM in response to Jeff Kelleher

Hi Jeff


If you had read my full post you would have seen.


"I do this type of editing very rarely. But I point this out to show the problems that this Lion has created with the automatic revisions."


I used Coda from Panic most of the time http://www.panic.com/coda/


I also pointed this out because you use to be able edit anything in text edit. But it automatically converted and saving it as something else shouldn't happen… Telling me I can just use another editor is not even remotely addressing my issue.

Oct 28, 2011 9:22 PM in response to Kelton

There really is no way to "address your issue" except to suggest you use TextWrangler instead, and also complain to Apple. You can not stop auto-save nor versioning in TextEdit (nor in Preview or Pages for that matter), nor get 'Save as...' back.


That said, TextEdit should not have done anything to a php file except open it as a plain text file. The "Locked" that appears in the title bar means in order to change anything in the file you have to mouse over the "Locked" in the title bar until you see a small undistinguished triangle, and then click on the now visible disclosure triangle that has appeared and either Unlock, to change that file, or choose Duplicate to get a copy to work on. Or you can simply attempt to make a change, and you will get a drop down sheet offering those two choices. If you unlock the file "Locked" will change to Edited and the disclosure triangle will then allow you to look at your current version and the original, and you can restore the original.


I assigned php files to TextEdit to open, and I also have "Ignore rich text commands in HTML files" checked in TE prefs, Open and Save section, and the default format is Plain Text.

Francine

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Opening PHP File in Text Edit

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.