Running command line app from the desktop

brianleahy

Colonel Panic
Glad you asked! I can tell you at least one way.

First, you CAN write Unix shell scripts & run them with OSX - and these are very much like DOS batch files, but personally, I don't know of a way to put those directly on the desktop.

But there is another scripting tool called AppleScript. Search your HD for an app called "Script Editor" - this is used to create and modify AppleScript programs.

There is an applescript command that goes:

do shell script "insert unix command here"

You can put in any UNIX command line commands you want.

Then you can "Save As Application" from the File menu, and you're off and running. You'll get an application icon that can be parked in the Dock, the desktop, or wherever you like.
 
Hi, I am very new to MacOSX but I was wondering if there was a way to make applications that run from the terminal work as double-clickable applications? Is there an OSX version of a Windows batch file, ie something that can be double clicked and will execute terminal commands?
 
Fokman - I'm not familiar with that trick. Do you mean Applescripts or Unix shell scripts? And what will the net result be?
 
this works for anything you can start from the command line. Do if you heva a script called hello.sh rename it to hello.command, and now you can double click it from the finder. It will then open terminal.app
 
I have had some better success using AppleScript to call terminal commands or scripts and saving them as apps.

You can easily turn those apps to background ones using a series of tricks or utilities (search on this forum). That is very convenient as then they do not show on the Dock.

There is also a nifty util called OnMYCommand that lets you run CLI stuff via a smart contextual menu. Cool.

Even cooler. There is a 'cat' mod out there that can use the Speech on MacOSX to 'talk' whatever input it receives. That can be useful to notify status or results of background shell commands or processes.

Welcome to the thriving Mac community!!! :)

Dani++
 
Back
Top