Skip to content

Making macOS Scripts Executable

RK edited this page May 4, 2020 · 8 revisions

You can only run executable macOS scripts.

Before you begin

  • If needed, download a macOS script that you want to run.

Procedure

  1. Open the Terminal by doing the following:
    1. Press Cmd and Space.
    2. Enter terminal.app
    3. Press Enter.
  2. At the prompt, enter chmod 755 *<script_filepath>*. Where: <script_filepath> is the path to the script that you want to make executable.
    Tip: You can drag-and-drop a file into the Terminal window to quickly enter its file path. Dragging and Dropping Files into Terminal Example: chmod 755 /users/*<your_user_name>*/Downloads/<script>

Next steps

  1. To run the script, double-click the script that you made executable.
  2. If needed, accept every security prompt. See Accepting macOS Script Security Prompts.

Troubleshooting

  1. If the script still does not run, at the prompt, enter xattr -rc <script_filepath>. Where: <script_filepath> is the path to the script that you want to make executable.
    Example: chmod 755 /users/*<your_user_name>*/Downloads/<script>
  2. To run the script, double click the script that you made executable.
  3. If needed, accept every security prompt. See Accepting macOS Security Prompts.

Clone this wiki locally