Double-click to run...?

Started by cormullion, August 21, 2007, 04:33:47 AM

Previous topic - Next topic

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

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


#!/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 filesnewlispnewlisp.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...



http://artfulcode.net\">Artful code

cormullion

#2
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

#3
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...



http://artfulcode.net\">Artful code

cormullion

#4
Thanks Jeff! Good idea.



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