image
image

|


Go Back   macosx.com > Mac Help Forums > HOWTO & FAQs

Reply
 
Thread Tools
  #1  
Old December 6th, 2002, 02:07 PM
Registered User
 
Join Date: Aug 2002
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
MikeDC is on a distinguished road
Running command line app from the desktop

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?
Reply With Quote
  #2  
Old December 6th, 2002, 02:22 PM
brianleahy's Avatar
Colonel Panic
 
Join Date: Sep 2000
Location: Northern Ohio
Posts: 1,579
Thanks: 0
Thanked 0 Times in 0 Posts
brianleahy is on a distinguished road
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.
__________________
OS X 10.4
G5 Dual 2GHZ / 160GB / 1GB RAM / Superdrive
Apple 20" Cinema Display
SmartDrive 120GB Firewire HD
Maxtor 250GB SATA


Visit my wife's eBay store !!

http://stores.ebay.com/Catchy-Creations-by-brendaonline

Now pining for a MacBook Pro...
Reply With Quote
  #3  
Old December 7th, 2002, 12:10 AM
ex2bot's Avatar
Mac Fanbot
 
Join Date: Apr 2002
Location: live?
Posts: 1,357
Thanks: 0
Thanked 0 Times in 0 Posts
ex2bot is on a distinguished road
Welcome to the Site, MikeDC!


-Doug
__________________
"Just as some newborn race of superintelligent robots are about to consume all humanity, our dear old species will likely be saved by a Windows crash. The poor robots will linger pathetically, begging us to reboot them, even though they'll know it would do no good." - Anonymous
Reply With Quote
  #4  
Old December 7th, 2002, 06:00 AM
Registered User
 
Join Date: Aug 2001
Location: Amsterdam
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
fokman is on a distinguished road
just rename the script so it ends with .command
Reply With Quote
  #5  
Old January 28th, 2003, 10:45 AM
Mr Tea's Avatar
Registered User
 
Join Date: Sep 2002
Location: Wales
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Mr Tea is on a distinguished road
Adding to brianleahy's comment - AppleScript is indeed an easy way to run shell scripts, and you don't even need to save them as applications. Inside the Applications>AppleScript folder you'll find a little doohickey called ScriptMenu.menu which provides a dropdown menu in the system menu bar. You can run any compiled script from there by placing it in a 'Scripts' folder in your own Library folder or the top level Library folder on your startup disk.

For up to date info on including shell scripts in AppleScripts, check out Apple's recent TechNote TN2065 on this subject at http://developer.apple.com/technotes/tn2002/tn2065.html

Last edited by Mr Tea; January 28th, 2003 at 10:53 AM.
Reply With Quote
  #6  
Old January 30th, 2003, 01:20 AM
Registered User
 
Join Date: Jan 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
ibme is on a distinguished road
there's a small program - Mac scriptGUI - that will
turn a script into a double-clickable applications
or a droplet

search on Google for:Mac scriptGUI
Reply With Quote
  #7  
Old March 1st, 2003, 02:47 PM
Ebonit's Avatar
Registered User
 
Join Date: Dec 2001
Location: Netherlands
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Ebonit is on a distinguished road
It is much easier , like fokman, three posts before, points out! You don't have to use apple script at all. just make a script in your favourite text editor and save it with the .command extension.

When you doubleclick this script, it will open a terminal and run your script..

NOTE! when using BB-edit you have to change the options settings in the save as menu:
Save State should be set to MPW Shell
Line breaks -> Unix ( i'm not sure if this is nessesary, i just put it that way).
If you keep the default settings you'll find that BB-edit opens the file when you doubleclick it.
__________________
500Mhz G4 powerbook "Wallstreet" - MacOS X 10.2.4 + 350Mhz G4 Umax S900 - MacOS X 10.2.4 + 233Mhz iMac - MacOS 9.2.2 + 200Mhz Powermac 4400 Mac OS 8.1 + P4 2.4 Ghz - Windows2000Server & XP pro + 366 Mhz Celeron - Redhat Linux 7.3 pro + 150 Mhz Pentium I - Susu Linux
Reply With Quote
  #8  
Old December 4th, 2007, 07:13 AM
Registered User
 
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
jsruok is on a distinguished road
No extra windows with AppleScript

However, if you use AppleScript, Terminal doesn't activate, and you don't get extra Terminal windows cluttering your display. This might be useful sometimes.
Reply With Quote
Reply

Thread Tools

Posting 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 Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get past icon changing bug in Finder jjones! Mac OS X System & Mac Software 11 November 11th, 2005 03:09 AM
Run applescript when mac wakes? anilsen Software Programming & Web Scripting 2 June 25th, 2003 04:48 PM
[HOWTO] Finder & Safari keyboard shortcuts wiz HOWTO & FAQs 2 January 12th, 2003 12:15 AM
[HOWTO] - Speed up finder on systems with little RAM Makosuke HOWTO & FAQs 10 October 20th, 2001 10:51 PM
AppleScript in the Finder in 10.1 (Spring-Loaded Folders???) simX Apple News, Rumors & Discussion 1 October 14th, 2001 09:27 PM


All times are GMT -5. The time now is 09:57 AM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.