Run Mac Scripts By Double-Clicking Them
The process listed on this page sets up a mac to run any file ending in `.bash`` in a command line terminal shell when you double-click on it. Scripts run that way have the power of full applications and can mess with, steal data from, or take over your computer.
The ability can be handy, but it adds to your responsibility of ensuring you don't run anything harmful.
If you only have one or a small number of scripts you wish to run by double clicking you can follow this same process but skip the step of doing "Change All..." Scripts you set up explicitly will work by double-clicking. Everything else will remain however it was before.
The Overview
The process of setting files to run when double-clicked has three parts:
-
Create a file
-
Give permissions to the file so it can run
-
Set the file to run in the Terminal when it's double-clicked
File Creation And Permissions
These first instructions use the Mac's Terminal app to type in commands. It's in the Utilities folder inside Applications in the Finder. Open it and you'll see something like this (but with your username and computer name instead of "alan" and "dojo" which are mine)
