Opening files in the Desktop

James Board

Registered
I want to add a file to the Desktop, and I want to open it with a specific text editor (emacs) whenever I click on it. So far, I made that file, copied it into the Desktop directory, and I tried to set the application which opens it via a right-click "Open-with" menu item. But when I try to select executable for that file (again, emacs), that application is greyed out and I can't set that application to open it.

So, how can I do it. When I click on the file, I want a window to be opened with emacs running and editing that file.
 
At the bottom of the choose application Window, there is a drop down menu named "enable" that is set by default on recommended applications. Click the drop down and select all applications.
 
I tried the "enable" menu and selected "all applications" but my app, which is a binary executable file that I typically run from an xterm, is still greyed out and I can't select it.
 
If it is an X-based application, then why didn't you say that in the first place? Launch X11 and then start it using xterm.
 
It isn't an x-based application: it's a text-based editor that typical runs in an xterm.

How can configure it so that it will launch X11 and then start it using an xterm?
 
I'm very new to Apple software and Mac OS, so apologies if I'm don't state what I want to do exactly. I guess I carry with me assumptions from the Linux world....

Anyway, here's my precisely what I want to do: Create an icon in the desktop and configure it so that when I click that icon, it's starts some sort of terminal-like application (like, xterm, or the Mac OS equivalent) and then starts an arbitrary text-based application on it (in this case, emacs, which is a text-based editor). Is that possible?
 
If you want to run a command line session, then you can use MacOS X's built-in Terminal application. There are various and sundry other terminal emulators available for MacOS X. Some are free. Others are fee-based.

When you say xterm, then you imply that you are running X11 because xterm is one of three pre-configured X11 applications. The other two are xman and xlogo. You can't run xterm without X11 or an alternate port of the X Windowing System.

That said, why are you going all around Job's barn just to run Emacs? This venerable editor was ported to MacOS X eons ago. It is available here. Of course, you may prefer this port instead.
 
I know already how to create an xterm, or MacOS X's built-in Terminal application manually. And I know already how to start emacs, or vi, or various other text-based apps inside that xterm. What I don't know is how to make all that happen with a simple double-click from the Desktop.

Currently, when I double-click the file icon in the Desktop, it opens a window with the MacOS TextEdit application editing that file. I want to get to the state where functionally, it does almost exactly the same thing, but instead it's running emacs, or vi, or some other text-based application. Is that possible?
 
I know already how to create an xterm, or MacOS X's built-in Terminal application manually. And I know already how to start emacs, or vi, or various other text-based apps inside that xterm. What I don't know is how to make all that happen with a simple double-click from the Desktop.
Please don't talk about what you know how to do when you don't know squat.

Currently, when I double-click the file icon in the Desktop, it opens a window with the MacOS TextEdit application editing that file. I want to get to the state where functionally, it does almost exactly the same thing, but instead it's running emacs, or vi, or some other text-based application. Is that possible?
The following instructions assume that you have installed the application that you want to use. To set an application to launch when you double-click on a particular file or file type:
  • Single-click the file.
  • Press [cmd]+[i].
  • In the resulting dialog box, locate the Open with: pop-up menu. If you don't see the pop-up menu immediately below Open with:, then click the triangle at the start of the line to reveal the pop-up menu.
  • Click the pop-up to reveal the list of available compatible applications. Select the one that you want--Aquamacs or whatever.
  • If you don't see your preferred application in the list, then select Other...
  • Use the resulting File/Open dialog box to navigate to your preferred application.
  • You should now see the name of your preferred application immediately beneath Open with:.
  • If you want all files of this type to open with this same application, then click the Change All... button. If you want only this file to open with the selected application, then do nothing else.
 
Last edited:
Yes, I did all of those steps, even before my first post on this forum, and they didn't work. You might want to review my original question before insulting me, because it seems like you don't know how to do this any better than I do.

The problem is that I navigate to my preferred application, which is in a bin subdirectory of my home directory, and when I get to that application, I can't select it because it's greyed out.
 
...

The problem is that I navigate to my preferred application, which is in a bin subdirectory of my home directory, and when I get to that application, I can't select it because it's greyed out.
Small wonder. You are doing it wrong.

If you want to run emacs as a generic UNIX application, then you should look into Fink or MacPorts. If you want to run emacs as a full-fledge MacOS X application, then follow the instructions in my last few posts.
 
Has anyone solved this yet? I want to do the same as the OP - run a terminal-based app on a file on the desktop (or in my case in Finder).
I'm wondering if there is an AppleScript way to do it perhaps? - can you drive the Terminal from Applescript?
 
Back
Top