Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Create sets of applications for easy launching UNIX
Many people use applications in groups or sets. This would require finding and double-clicking on several applications. Here is a way to make a double-clickable file that will open multiple applications at the same time.

In this example, I will be opening Explorer, Navigator and Mail. I am assuming these programs are all in your /Applications folder. If not you just have to modify the paths. Using your favorite text editor (vi, pico, BBEdit), create a new document and type in the following:
 #!/bin/tcsh
open /Applications/Internet Explorer.app&
open /Applications/Mail.app&
open /Applications/Navigator.app&
exit
If would like to add more applications, go ahead and insert a few more "open" lines with the appropriate paths. Now, save the file as open.command and put it somewhere convenient like your desktop. If you want, you may change the part before the .command to anything else (like fun.command), but you must leave the .command part at the end. Next, go into a terminal and cd to the directory containing the open.command file. Type this at the prompt:
 % chmod +x open.command
This makes your open.command file executable. Go to the desktop and double-click on the open.command file. Internet Explorer, Navigator and Mail should be launching.

If you find the plain file icon boring, dress it up with a cool custom icon.
    •    
  • Currently 4.00 / 5
  You rated: 4 / 5 (3 votes cast)
 
[4,329 views]  

Create sets of applications for easy launching | 19 comments | Create New Account
Click here to return to the 'Create sets of applications for easy launching' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Easier
Authored by: bluehz on Oct 29, '02 10:52:03AM
An even easier way of doing this - after creating the script, you can move aliases in and out of a directory to modify action instead of hardwiring the launched apps into the actual script. Create dir somewhere and fill it with aliases of apps you want to open. Say for example. ~/Documents/LoginApps Then create this shell script (as described in original hint). Naming it something with .command at the end.
#!/bin/sh # This will open all apps who have aliases in the LoginApps dir. /usr/bin/open /Users/username/LoginApps/* # The rest of this is optional, I use the script as a startup app # by placing it in the LoginItems, then all the apps are launched # at boot. The code that follows simply hides all teh apps it opens # and leaves me a nice clean Desktop/Finder view each restart. You # can delete as desired. Also - the original sleep command may # need to be tweaked to your needs. It must wait for the apps to # at least partially open before the applescript below can actually # hide them. /bin/sleep 45 # this is an applescript that hides all apps and returns to the Finder /usr/bin/osascript

[ Reply to This | # ]
Easier
Authored by: bluehz on Oct 29, '02 10:55:38AM

Sorry - I have tried EVERYTHING to get this thing to post the proper characters req to display the script above - its not going to do it. It displays fine in the preview then as soon as I hit the submit button it mangles the last of the script.So the script above is chopped of at the end. Just remove everything BELOW

/usr/bin/open /Users/username/LoginApps/*

and it will work fine

PS - is there a guide somewhere on just what Geeklog will accept and what it mangle and maybe some tips from teh pros on sneaking stuff in...



[ Reply to This | # ]
Easier
Authored by: stephen007 on Nov 05, '02 09:36:15PM

So, how can i get it to hide all the apps and return to the Finder?

# this is an applescript that hides all apps and returns to the Finder

Thanks,

Stephen



[ Reply to This | # ]
applescript answer
Authored by: poultryfarm on Nov 07, '02 06:11:06PM

try this applescript:

tell application "Finder"
set visible of every process whose visible is true and name is not "Finder" to false
end tell



[ Reply to This | # ]
Easier
Authored by: diskgrinder on Oct 31, '02 08:03:51AM

am I doing something stupid?
I wrote it in bbedit, saved with .command, chmodded, doubleclicked, and it just opened the file in bbedit again???



[ Reply to This | # ]
Easier
Authored by: diskgrinder on Oct 31, '02 09:20:58AM
figured it out - I hadn't used "open with" to change the opening app to the terminal

[ Reply to This | # ]
how do I close the terminal window automatically?
Authored by: elroybob on Oct 29, '02 12:02:47PM

/usr/bin/open /Users/username/LoginApps/*

This works, but leaves an open terminal window (process finished) in it's wake. Forgive my newbie question, but how do I get it to automatically close the terminal window when it is done?

Thanks.



[ Reply to This | # ]
re: how do I close the terminal window automatically?
Authored by: thatch on Oct 29, '02 02:16:57PM

From Terminal in the menu bar: Window Settings...: Shell, select 'Close the window' or 'Close only if the shell exited cleanly', then select 'Use Settings as Default'.



[ Reply to This | # ]
re: how do I close the terminal window automatically?
Authored by: dr_turgeon on Oct 29, '02 03:02:40PM

For some reason this doesn't work for me either...



[ Reply to This | # ]
re: how do I close the terminal window automatically?
Authored by: elroybob on Nov 01, '02 05:08:00PM

Thanks, but I'd already done that and the window still stays open. Is there a way to make the terminal widow close with a command inside the script?

Thanks



[ Reply to This | # ]
re: how do I close the terminal window automatically?
Authored by: kerbaugh on Nov 19, '02 01:15:22PM

Try the following, at least if the server prints the whole thing:

osascript<<END
tell application "Terminal"
close the front window
end tell
END



[ Reply to This | # ]
Easier? Newbie question
Authored by: jschank on Oct 29, '02 02:26:37PM

Wouldn't all of this be easier if you just used an AppleScript to do the launching. I assume then, that you wouldn't need a terminal at all.
Am I wrong?



[ Reply to This | # ]
Easier? Newbie question
Authored by: MrWinther on Oct 29, '02 05:02:21PM

I think so, but I am a newbie to.... ;-)

Thats why I use quickeys. Much easier.



[ Reply to This | # ]
AppleScript Solution
Authored by: Duncan Mok on Oct 29, '02 09:19:10PM
Yes. Very easy. As in the following:
    tell application "Finder"
      	 open "Applications:Internet Explorer"
      	 open "Applications:Mail"
   	    open "Applications:Netscape:Netscape"  
    end tell
Note that you don't always have to specify the full path, but I ran into a problem with the Mail application where a Classic application of the same name was being launched instead of the Mac OS X Mail.app. Pretty simple, really. There are hints elsewhere on this site to explain how to make this a double-clickable application, complete with icon, if that's what you want to do. Cheers, Dunk

[ Reply to This | # ]
AppleScript Solution
Authored by: bluehz on Oct 29, '02 11:03:36PM

I agree - Applescripts are much easier to use. I have used Applescripts for years...but in my opinion there is a noticeable lag in Applescripts in OS X that does not exist with shell scripts - even when the shell scripts use some AppleScript. I personally am migrating away from Applescript - but some things you will never be able to do in shell script with Unix. Its absolutely amazing that we in OS X have this incredible interaction that can take place between shell scripts and AppleScript. The possibilities really are endless.

Use whatever makes you comfortable though - thats what counts.



[ Reply to This | # ]
AppleScript Solution
Authored by: lebowski on Oct 30, '02 05:09:38AM

I'm new to applescript, so bear with me.

I put the script into ScriptEditor and then saved the file to my desktop. I then double-clicked the file, and it re-opened scrit editor. I then had to click the 'run' button to make the script actually run.

Is this the only way to do it? Isn't there a way to make the script run when i double click it?

cheers,
L.



[ Reply to This | # ]
AppleScript Solution
Authored by: lebowski on Oct 30, '02 05:23:59AM

Forget my last post about how to make the script and application - i found the answer in Help of all places.

What i would like to know tho, is if this method can be applied to Documents as well as apps. I just added another line
open "Home:Documents:Stuff:Radio:BBC Radio2.ram"
hoping that it would also open the streaming Radio link in RealOne like it's supposed to - didn't work of course.

any suggestions?

L.



[ Reply to This | # ]
For Speed Use DropScript
Authored by: thinkyhead on Oct 30, '02 01:12:30PM
Once you've made your launch script, drop it on DropScript to turn it into a native Cocoa application. The script will then execute without opening Terminal and it will execute much faster than the equivalent AppleScript.

[ Reply to This | # ]
applescript to launch files as well as applications
Authored by: jason mark on Nov 09, '02 08:48:10PM

I'm pretty sure you have to tell an application to launch the file.

so say:

Tell "Internet Explorer"
open "Home:Documents:Stuff:Radio:BBC Radio2.ram"
end tell

I would guess you could even send this script right to the finder, and let the finder figure out what app to open it with.



[ Reply to This | # ]