How to add chmod +x on a file, from right click menu service in mac

13,627

It is essentially the same steps. I think you just need the right script and parameters.

  1. Launch automator
  2. Choose Service
  3. Make sure Service is set to receive "selected files and folders" in "Finder"
  4. Add an action - type Run Shell Script
  5. Change the actions options to Shell: /bin/bash, Pass input: As Arugments
  6. Now you want to add your shell commands. Since you already know you need chmod +x as your command, we just need the right paramters to pass along the file received. This will be chmod +x "$@"
  7. Save the service (by default will go in ~/Library/Services)

You should now be able to select an individual file and use the Services menu to add the executable flag.

enter image description here

Share:
13,627

Related videos on Youtube

Pabate
Author by

Pabate

Updated on September 18, 2022

Comments

  • Pabate
    Pabate almost 2 years

    so i need to use chmod +x alot, and i thought it could be easier to make a service in Automator to add it to the right click menu, so it will run chmod +x on the selected file as choose it from the right click menu ive no idea how to do that so any help would be appreciated

    something similar to this: Add a custom terminal command to context menu in mac

    whats the command i need to right in order to tell it to run chmod +x on the file when i right click it?