Skip to content

Making macOS Scripts Executable

Rafał Karoń edited this page Aug 31, 2024 · 2 revisions

You can only run executable macOS scripts.

Before you begin

  • If needed, download a macOS script to run.

Procedure

  1. Open 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 drop a file into Terminal 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 to make executable.
    Example: chmod 755 /users/*<your_user_name>*/Downloads/<script>
  2. To run the script, double-click the script.
  3. If needed, accept every security prompt. See Accepting macOS Security Prompts.
Clone this wiki locally