I want to open all txt files in my home directory with emacs, but not all the others with text edit, is that possible? How could it be done?
Open Automator and create a new application. Add a single Run Shell Script action that receives input as arguments, and has the following script code:
Save as e.g. "Conditional Open Text Files"
Open the Get Info dialog of a
This will cause all text files to open with this script application, which looks at the file path and decides based on that whether to open the files in TextMate or TextEdit. Use the application name of your particular emacs instead to make this work with e.g. Aquamacs.
If you want to get a nicer icon than the default "unknown document" icon, follow these instructions.