A Folder Action Script to auto-set the Execute bit

May 03, '07 07:30:00AM

Contributed by: dayhox

This is a simple Folder Action Script that will set the executable bit on any file saved within the folder to which the script is attached. Copy and paste the following into a Script Editor document, and save it as a script into your Folder Action Scripts directory.

on adding folder items to thisFolder after receiving theItem
  set fileName to POSIX path of theItem
  do shell script "chmod +x " & fileName
end adding folder items to
Remember to call your shell (#!/bin/bash) or application (#!/usr/local/bin/ruby -w) in the first line of your script. Then save to, or drag your file to, the folder with the action script attached.

Comments (2)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20070502131117675