Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Execute Shell Script in Finder Without Opening Terminal

Execute Shell Script in Finder Without Opening Terminal
Thread Tools
Registered User
Join Date: Nov 2002
Location: Far from the internet.
Status: Offline
Reply With Quote
Dec 28, 2004, 07:36 PM
 
I know I can execute a shell script from within the finder by appending .command, but this opens the terminal. Is there any way to execute a shell script without opening the terminal? Or if not, how would I do this in AppleScript?

Code:
#!/bin/sh cp -f /Volumes/Music/iTunes/iTunes\ 4\ Music\ Library ~/Music/iTunes/ cp -f /Volumes/Music/iTunes/iTunes\ Music\ Library.xml ~/Music/iTunes/ open -a /Applications/iTunes.app
Thanks!
     
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Dec 29, 2004, 06:06 AM
 
I'd try Platypus. It will turn any shell script into a stand-alone double-clickable OS X application.
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Dec 29, 2004, 09:45 AM
 
probably the easiest thing for you is to use the Script Menu (/Applications/AppleScript/Install Script Menu)

It runs shell scripts as well as applescripts - just drop the scripts into ~/Library/Scripts

If you do want to use applescript then there is a command "run shell script"

so, you could do something like this:

Code:
set myScript to "cp -f /Volumes/Music/iTunes/iTunes\ 4\ Music\ Library ~/Music/iTunes/ cp -f /Volumes/Music/iTunes/iTunes\ Music\ Library.xml ~/Music/iTunes/" do shell script myScript tell app "itunes" to activate
     
benb  (op)
Registered User
Join Date: Nov 2002
Location: Far from the internet.
Status: Offline
Reply With Quote
Dec 29, 2004, 02:28 PM
 
Originally posted by Simon:
I'd try Platypus. It will turn any shell script into a stand-alone double-clickable OS X application.
Thanks, worked like a charm!
     
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Dec 29, 2004, 02:33 PM
 
Originally posted by benb:
Thanks, worked like a charm!
Anytime.
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Dec 29, 2004, 03:29 PM
 
There's also a filename extension that you can give the script, but I forget what it is. Does anyone else here remember? .termcmd or something like that?
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Dec 29, 2004, 03:30 PM
 
Originally posted by Millennium:
There's also a filename extension that you can give the script, but I forget what it is. Does anyone else here remember? .termcmd or something like that?
Read the thread, it's in the first post.

.command
     
   
Thread Tools
Forum Links
Forum 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 On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:18 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2