Double-click to run...?

Guiserver, GTK-server, OpenGL, PostScript,
HTML 5, MIDI, IDE
Locked
cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Double-click to run...?

Post by cormullion »

is there a way to get these newLISP-GS 'applications' to be double-clickable...? I notice that the newLISP-GS editor in /Applications is, but I don't see how to use a similar idea to launch a text file...

Jeff
Posts: 604
Joined: Sat Apr 07, 2007 2:23 pm
Location: Ohio
Contact:

Post by Jeff »

In OSX, add a hash-bang path at the top of the main application:

Code: Select all

#!/usr/bin/newlisp
And make sure that it has (exit) at the end. Then, make the program executable by running "chmod +x /path/to/foo.lsp" in your terminal.

In Windows, make sure .lsp files are associated with the newlisp interpreter (c:\program files\newlisp\newlisp.exe I think).

In Linux, it depends entirely on the desktop environment you are using. If it is Gnome, there is some hugely arcane procedure involving fifteen apps that edit different aspects of your gconf database. Then you have to restart Gnome, log in as root, play a game of tetris, recompile your kernel including the "Run newlisp files using newlisp interpreter" option as a loadable module, then rebooting to your new kernel. If there are any problems, be sure to search Usenet and IRC logs before asking for help, or expect to be told to RTFM.

;)
Jeff
=====
Old programmers don't die. They just parse on...

Artful code

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

Trouble is, I'm on OSX, so double-clicking a file opens it up in my text editor, even it it's executable. I'll see if there's a way of telling the Finder to run some newLISP files as shell commands...

Jeff
Posts: 604
Joined: Sat Apr 07, 2007 2:23 pm
Location: Ohio
Contact:

Post by Jeff »

There is a preference pane you can download called "Default Apps" that will let you assign by protocol or extension. However, if you control-click or right-click a file and choose open with, you can select on a per-file basis (but that doesn't affect other files of the same extension). If you can't get it to open directly to the newlisp executable, point it to the terminal app and it will launch as a shell process in terminal.app.
Jeff
=====
Old programmers don't die. They just parse on...

Artful code

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

Thanks Jeff! Good idea.

And after a bit of googling, I found another possible solution - Platypus. http://www.sveinbjorn.org/platypus (MacOS X only). It converts shell scripts to Finder-friendly double-clickable applications.

Locked