7

When I use Mac, I tend to have to open a stack of applications at once, specifically:

  • Unity Hub
  • Visual Studio
  • Terminal
  • Opera

OR

  • MAMP
  • Visual Studio Code
  • Opera
  • Terminal

So I was thinking about adding an icon on the dock or on the desktop to start all these applications with a single click. Is there a way?

Up to now I just found a way to do this with BASH, but I should run it from the terminal...

2
  • 1
    Abother way is to note you don't need to shut things down. Let the OS deal with inactive apps by swapping them out. (I do find web browsers are an exception and you need to close them every now and then)
    – mmmmmm
    Nov 9 '21 at 9:27
  • @mmmmmm I really don't understand what you mean, but the given answer is exactly what I needed
    – ZioCain
    Nov 9 '21 at 9:36
10

Yes, you can use Automator to create a workflow as an application, adding as many Launch Application actions as you wish. I'd also add a Pause action in between.

You can then drag the application from Finder onto the Dock if you wish.

enter image description here



Or you could use AppleScript in Script Editor, saved as an application, using as many tell application "appName" to launch statements. I'd also add a delay command in-between each.

Example AppleScript code:

property appNamesList : {"Chess", "Contacts", "Dictionary", "Font Book"}

repeat with appName in appNamesList
    tell application appName to launch
    delay 2
end repeat
3
  • 2
    Quick question: why should I put a pause?
    – ZioCain
    Nov 9 '21 at 9:16
  • 1
    @ZioCain, RE: "terminal is not among the listed application, where do I find it? Also: why should I put a pause? " -- In the pop-up list scroll down to Other… and then navigate to Applications > Utilities > Terminal. The reason for the Pause action is so you don't hammer the CPU, however you don't have to. Nov 9 '21 at 9:23
  • Thank you! I did find the Terminal! - The pause thing doesn't seem to be a problem, but will add it if needed.
    – ZioCain
    Nov 9 '21 at 9:29
4

If you did not have a bash script already, I'd tell you to do as per the answer given by user3439894.

But if your already have a bash script (say, named ~/open_apps.sh), you can create an Apple Script with the Script Editor application that says:

do shell script "~/open_apps.sh"

And then, Save the script to your Desktop, for instance, using Application as the file format, leaving unchecked the checkboxes for Show startup screen and Stay open after run handler.

After that, you can now launch that script (and hence your applications) by double clicking your new AppleScript application.

2

I do this by adding apps to the Login Items for my user in the Users & groups panel in System Settings.

When I log in they start.

2
  • Yeah, that could work, but I don't need them to be opened at login everytime
    – ZioCain
    Nov 11 '21 at 15:44
  • 1
    @ZioCain no problem, just thought it was an option that may help others. Cheers.
    – Solar Mike
    Nov 11 '21 at 17:26
0

One option is to make a .command file. This is a shell script, but you can run it by opening it from the Finder.

Put this in a text file called openThings.command:

open /Applications/TextEdit.app
open /Applications/Stocks.app

If you want to be gentle, you could:

open /Applications/TextEdit.app
sleep 1
open /Applications/Stocks.app

And make it executable: chmod +x openThings.command.

Now you can double-click that in the Finder to run it.

3
  • This answer, as currently written, fails to execute properly on macOS Catalina and later. Take time to read the manual page for the open command as the -a option is supposed to be used when opening an application. While this method of opening applications works when properly coded, nonetheless, it leaves a useless Terminal window open that one then has to close. The other answers do not suffer from this shortcoming. IMO This method is not at all what the OP had in mind as he could have just double click his existing shell script and ended up with the same results. Nov 12 '21 at 4:09
  • I'm still on Mojave here, but double-clicking a .sh file just opens it in TextEdit. Do later versions of macOS act differently?
    – aswine
    Nov 16 '21 at 17:21
  • Just to name a few, like the 200+ POSIX shell script text executable, ASCII text files in /usr/bin, only one of which has an .sh file extension, I do the same as Apple and not needlessly give my executable shell scripts an .sh extension and if doubled-click in Finder do the exact same as you've described adding .command. I think most would agree one does not want to have to close a non-active window from Terminal every time under the conditions expressed in the question when tying to simplify an automated process. Nov 16 '21 at 19:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .