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

Launch applications by name using Applescript System
Quite often I use the Terminal to launch an application using open -a application_name. This is faster than traversing any menus or folders. An even faster way would be to put that functionality on a hotkey, so I wrote a small script which I launch using Dragthing (although there are several other alternatives).

The script shows a dialog and you can simply enter the Name of the application which has to be launched:
tell me
  activate
  set s to display dialog "Which appliation do you want to start?" default answer "Safari"
  do shell script "open -a \"" & text returned of s & "\""
end tell
Copy and paste into the AppleScript Script Editor, save it as an application, and then use DragThing (or similar) to assign it a hotkey.
    •    
  • Currently 3.17 / 5
  You rated: 3 / 5 (6 votes cast)
 
[50,994 views]  

Launch applications by name using Applescript | 27 comments | Create New Account
Click here to return to the 'Launch applications by name using Applescript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Launch applications by name using Applescript
Authored by: webentourage on Jan 21, '04 11:18:08AM
If this hint is even remotely of interest to you, then you need to try LaunchBar. I'm not associated with it in any way other then the fact that I can't use a mac without it. It learns how you work, and makes any hotkey programs seem almost silly. It is amazing. http://www.obdev.at/products/launchbar/

[ Reply to This | # ]
Launch applications by name using Applescript
Authored by: magir on Jan 21, '04 11:35:20AM

Thanks for suggesting LaunchBar. I heard of it before but I see no reason for paying 20 USD when I get it for free using an Applescript ;-).



[ Reply to This | # ]
Launch applications by name using Applescript
Authored by: sharumpe on Jan 21, '04 11:54:18AM

Ahh, but you don't get anywhere near the same level of usefulness with the Applescript as you would with LaunchBar.

Download the demo, and use it for a few hours. I paid the $20 within about an hour of downloading and using the demo. It is the first thing I install on a new machine/OS. Indispensable.

Mr. Sharumpe



[ Reply to This | # ]
Launch applications by name using Applescript
Authored by: Azark on Jan 21, '04 11:56:28AM

If you think you can do the same as LaunchBar with a simple Script, you're dreaming!
Just try it, it's shareware.
The more you use it, the better it gets.
This is one of the most useful utility for OS X. (As LittleSnitch from Obdev too)
Those guys rocks. IMHO, this is one of the best mac dev crews, with Panic, BareBones, etc.
Definitely worse a try.

I'm not affiliated blah blah

---
PB Ghz 1024 Combo
G4 400 AGP



[ Reply to This | # ]
Launch applications by name using Applescript
Authored by: edoriv on Jan 22, '04 09:44:15AM

While I love and use applescript for many tasks... there is no comparison of an applescript no matter how complex you could try to make and Launchbar... Same here... I tried launchbar and within 1 day HAD to buy it... it's simply the easiest way to launch and app, switch to an app, navigate you drives files, launch bookmarks and email addresses just too sweet...

you see this applescript while nice only launches apps... launchbar actually looks at your bookmarks inside safari or other browser and your contacts in address book and with a simple command space pops up a place to start typing...

as you type it shortens the list of found items :-) hit enter and it launches the item.

or while the list is showing drag and drop a file on it and it will open that file in that app

hold command while hitting enter (return) and it will open a finder window the selected item is in

this is just the very tip of the iceberg!!! it does sooooooo much! you simply HAVE to try it a few days and it wouldn't hurt to actually read the read me because all it can do is not immediately obvious!

if at first you don't realize all it can do and don't think you will like it give it a little longer and really try it out... I doubt many will think it's not worth the $20.00

simply one of the best must haves on os x!



[ Reply to This | # ]
LaunchBar does this perhaps better?
Authored by: tandemrepeat on Jan 21, '04 11:20:49AM
An even faster way is to use LaunchBar...possible the most useful application I've ever used.

Not affliated etc. with the company...

[ Reply to This | # ]

LaunchBar does this perhaps better?
Authored by: TvE on Jan 21, '04 12:28:20PM

Ha - I was just going to say "LaunchBar" - but I am very happy to see that several other MAOSXH-users beat me to it - and I also would like to see the AppleScript that has the same features(!)

One difficult to re-create feature is it's learning abilities - "So you want to change "NU" from activating "Norton Utilities"* to "Network Utilities" - no problem it actually happens without any extra input from you, you just choose the other app - and next time it's automagically chosen when I hit "CTRL-SPACE...N...U"


*I think you should erase that app from your HD



[ Reply to This | # ]
LaunchBar does this perhaps better?
Authored by: dogboy on Jan 21, '04 07:44:33PM

I agree. Launchbar is the best piece of software I have bought. Except Photoshop.



[ Reply to This | # ]
Launch applications by name using Applescript
Authored by: Faust on Jan 21, '04 12:24:31PM

Launchbar is great, but pearcalc does at least the thing described here great as well - and is free!
(I don't get money from the freeware author ;-) )
cheers,
Dirk



[ Reply to This | # ]
Launch applications by name using Applescript
Authored by: wOOge on Jan 21, '04 12:32:56PM

And if you think launch bar rocks, try:

"Another Launcher"

Same abilities as this script, and launchbar - but Donationware of $15!!

check it out:
http://www.petermaurer.de/nasi.php?thema=launcher&sprache=english

---
--

wOOge
http://mac.axonz.com



[ Reply to This | # ]
Launch applications by name using Applescript
Authored by: sfgecko on Jan 21, '04 03:36:04PM

i agree... Another Launcher is a great app that does what LaunchBar can do and more. it's a little confusing to setup at first, but once you do, you'll realize just how powerful it is. and it's donationware, so you can send a payment to the author if you choose to. after you use it for a while, you'll feel guilty that you didn't.



[ Reply to This | # ]
Another Launcher was a bit slow
Authored by: jecwobble on Jan 22, '04 10:33:30AM
I have rather simple needs from a user interface standpoint. I tried Another Launcher for a while, and I got the hang of setting it up okay. But aside from the hot-key feature (which I already had from iKey), the 'application launch by typing a few characters' was the only feature I used. I have not tried LaunchBar yet, but this feature in Another Launcher was too slow in my opinion.

[ Reply to This | # ]
Another Launcher was a bit slow
Authored by: aranor on Jan 22, '04 12:31:45PM

Too slow? LaunchBar is blazingly fast! Try it!



[ Reply to This | # ]
Another Launcher was a bit slow
Authored by: jecwobble on Jan 22, '04 03:46:07PM
These two app's names are too similar: I said that Another Launcher was a bit slow in my opinion. I said that I had not yet tried LaunchBar.

[ Reply to This | # ]
Another Launcher was a bit slow
Authored by: feelphree on Jan 24, '04 12:10:13PM

I have used both of these programs and am currently using Anohter Launcher. I agree with some of the other posts that LB is amazing in its simplicity, but with a few tweaks of AL you can get the same functionaity plus have a little more flexibility. AL is a little slow at first as it defaults to searching a good portion of the searchable locations everytime you enter text. If you shorten this list by excluding folders/indicies you don't use then it runs much more quickly. Before I customized this I was thinking about switching back to LB becasue AL was much slower (as others have mentioned), but now it runs just as fast. The display is a little more obtrusive, but I have started using some of the other features and I am really getting into it.

But then again I haven't checked back in on LB to see if there are any new features for a couple of months, maybe it's time...


Bryan



[ Reply to This | # ]
Quicksilver
Authored by: njitkoff on Jan 21, '04 12:53:20PM
You could also try quicksilver ;)

http://www.blacktree.com/apps/quicksilver/

[ Reply to This | # ]

Quicksilver
Authored by: alternapop on Jan 21, '04 06:00:19PM

quicksiliver is very cool and i use it all the time. can't beat the price either. love it!



[ Reply to This | # ]
Launch applications by name using Applescript
Authored by: subrama6 on Jan 21, '04 01:52:30PM

recently switched from windows but had a lot of linux experience too, and liked the idea of having a terminal open. if you have a terminal open all the time like i do, another alternative is available here http://resexcellence.com/hack_html_01/10-10-01.shtml. it is essentially a shell script that parses the /Applications folder and makes a file with an alias for each entry. set your login file (.tschrc for me) to source script file on a new terminal session and you're all set. i've found this indispensable for keeping my desktop free and clear. no need for hotkeys, nor for paying for launchbar.



[ Reply to This | # ]
Launch applications by name using Applescript
Authored by: bryanchang on Jan 21, '04 02:26:16PM
With AppleScript you don't need to use shell script to launch an App:

set AppName to text returned of (display dialog "Which appliation do you want to start?" default answer "TextEdit")
tell application AppName to activate


[ Reply to This | # ]
Launch applications by name using Applescript
Authored by: subrama6 on Jan 21, '04 03:02:14PM

agreed - but with shell scripts, you don't need to have dialogs. again, the shell script solution is only valuable if you always have a terminal session open. but i do, so i try to avoid uneccessary dialogs.



[ Reply to This | # ]
Launch applications by name using Applescript
Authored by: jdhorner on Jan 22, '04 03:56:11PM

hmm. actually, using the "do shell script" command works no matter if you have terminal open, activated, running, etc...

---

-------
sig? who said anything about a sig?



[ Reply to This | # ]
Launch applications by name using Applescript
Authored by: mistercow on Jan 21, '04 10:33:52PM

One advantage of this method over the shellscript method is that it automatically adapts to making shortcuts.

For example, if you run this script and then type "txt" but don't have an application called "txt" on your computer, it will ask you to choose an application from a list of all applications. You can then select TextEdit, and from then on running this script and typing "txt" will open TextEdit.



[ Reply to This | # ]
LaunchBar
Authored by: Azark on Jan 21, '04 09:02:41PM
Sorry to argue again, but: Launchbar is different than all the script solutions. You can launch anything. Just tell him in the prefs what and where to scan. I just need command+space (or whatever) + 2 or 3 letters in most case to open or locate a file. Its 'guesses' are really amazing even if you never used that file and type something else than the first letters. You don't see LB when you don't use it and just a small bar in the upper right screen when you do. Another launcher is quite similar, but much more intrusive. I tried it and I don't remember all the reasons why but I found LaunchBar much better. I highly recommend a try. Be sure to set the configuration as you like. obdev.com I won't recommend any other app like this (except Little Snitch and BBedit).

---
PB Ghz 1024MB Combo 10.3.2
G4 400 AGP 768MB 10.3.2

[ Reply to This | # ]

LaunchBar is the best
Authored by: jason mark on Jan 23, '04 08:57:21PM

I've used Launchbar forever, I also tried Another Launcher (thinking I would install it on other machines I set up since it's cheeper), but ended up going back to launchbar. So clean and easy and fast.



[ Reply to This | # ]
Launch applications by name using Applescript
Authored by: rxmac on Jan 21, '04 11:57:58PM

great ! is it then possable to have that app open a document with in that app after the app opens .



[ Reply to This | # ]
Launch applications by name using Applescript
Authored by: rjw57 on Jan 22, '04 09:13:18AM

Desktop Manager for panther (http://wsmanager.sf.net/) also has this feature built in, Command-Option-R launches a box to type your app name.



[ Reply to This | # ]
Launch applications by name using Applescript
Authored by: eldritch on May 11, '11 12:36:47AM

I tried your script but the app I really want to open is Firefox. Unfortunately your script tries to install the Windows version on my machine and launches Parallels to attempt this. Can you think of a workaround? Thanks



[ Reply to This | # ]