Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Clicking on a file in the finder opens X11 Application.

Clicking on a file in the finder opens X11 Application.
Thread Tools
Fresh-Faced Recruit
Join Date: Dec 2003
Location: portland, or
Status: Offline
Reply With Quote
Dec 31, 2003, 11:55 AM
 
Hi,

I'm pretty new to the Mac so bear with me. Is there a way to allow the finder to open a file with an X11 application? For instance I do all my text editing in Xemacs, but for the life of me I can't figure out how to get a file to open in Xemacs when I click on it through the finder.

Thanks.
     
Posting Junkie
Join Date: Nov 2001
Location: Retired.
Status: Offline
Reply With Quote
Dec 31, 2003, 12:02 PM
 
"Get Info/Inspector" on the file you want to open with the application by hitting "Command+I" on the file...

Then, simply select which app to use under the "Open With" panel and hit the "Change all..." button if you always want it to open that kind of file with that app...
     
Mac Enthusiast
Join Date: Feb 2001
Location: London, UK
Status: Offline
Reply With Quote
Dec 31, 2003, 02:57 PM
 
Originally posted by gorickey:
"Get Info/Inspector" on the file you want to open with the application by hitting "Command+I" on the file...

Then, simply select which app to use under the "Open With" panel and hit the "Change all..." button if you always want it to open that kind of file with that app...
I don't think that's what he's looking for. To open documents in an X11 app through the finder you'll have to create a proxy applescript to handle passing the file reference to the X11 app.

This hint deals with something similar.

Good luck.
     
Mac Enthusiast
Join Date: Feb 2001
Location: London, UK
Status: Offline
Reply With Quote
Dec 31, 2003, 05:01 PM
 
Seeing as I'm feeling helpful today here's a bit more info after some research...

First of all, download platypus. It's open source, and very useful.

Platypus allows you to create Mac OS X applications that act as front ends to unix scripts of various varieties. We can also use it to create a double clickable application to run an X11 app, and also accept drag & drop and association through get info as described earlier.

Here's what to do to create a front end for xemacs:

1. In a text editor, create the script that will launch xemacs. Here's what I came up with:

open /Applications/Utilities/X11.app
export DISPLAY=localhost:0
/opt/local/bin/xemacs "$1"

I assume anyone that's unix friendly enough to want to use xemacs won't need those lines explaining. The first line launches X11 if it's not already open and makes it the active application.

2. Launch platypus. Click the 'select' button next to 'Script Path' and navigate to your script.

3. Fill in the 'App Name' field, and select the 'Shell' and 'Is Droppable' options.

4. Click create and choose a location for the new application.

You should now be able to double click on this application to run xemacs (assuming X11 is running). You can also drag and drop files onto the xemacs application (although this won't work with all file types), or change text files to open with the new xemacs application by default using get info.

If you wanted to modify the behavior of your new app, simply ctrl/right-click on it and select 'Show Package Contents', and navigate to Contents/Resources.

The various text files in this folder determine how the application acts.

Hope the above is of some use.
     
Professional Poster
Join Date: Dec 2000
Location: Milan, Europe
Status: Offline
Reply With Quote
Jan 1, 2004, 04:32 AM
 
BTW, some X11 "apps" (often with the exec terminal-like icon, in Panther) also work directly by double-clicking them: for example, if one has KDE installed with Fink, it's simple to open Konqueror by making an alias of /sw/bin/konqueror - putting the alias in your /Applications or ~/Applications folder, or on the Desktop, or wherever you like - and double-clicking it; of course, it's also easy, then, to paste a custom icon onto the alias itself...
(Last edited by Sven G; Jan 1, 2004 at 07:47 AM. )

The freedom of all is essential to my freedom. - Mikhail Bakunin
     
Sal
Dedicated MacNNer
Join Date: Sep 2000
Location: Cupertino, CA USA
Status: Offline
Reply With Quote
Jan 1, 2004, 07:25 AM
 
Just and FYI, but apparently many people don't realize that you can run Shell and Perl scripts from the system-wide Script Menu utility:

Applications > AppleScript

Just place the text file containing the Shell script in either of these locations and select it from the Script Menu:

~/Library/Scripts/

/Library/Scripts/
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 10:43 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2