|
#1
| |||
| |||
| 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? |
|
#2
| ||||
| ||||
| 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... |
|
#3
| ||||
| ||||
| 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 |
|
#4
| |||
| |||
| just rename the script so it ends with .command |
|
#5
| ||||
| ||||
| 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 11:53 AM. |
|
#6
| |||
| |||
| 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 |
|
#7
| ||||
| ||||
| 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 |
|
#8
| |||
| |||
| 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. |
![]() |
| Thread Tools | |
|
|
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 04:09 AM |
| Run applescript when mac wakes? | anilsen | Software Programming & Web Scripting | 2 | June 25th, 2003 05:48 PM |
| [HOWTO] Finder & Safari keyboard shortcuts | wiz | HOWTO & FAQs | 2 | January 12th, 2003 01:15 AM |
| [HOWTO] - Speed up finder on systems with little RAM | Makosuke | HOWTO & FAQs | 10 | October 20th, 2001 11:51 PM |
| AppleScript in the Finder in 10.1 (Spring-Loaded Folders???) | simX | Apple News, Rumors & Discussion | 1 | October 14th, 2001 10:27 PM |