4

Is there a way to set make a file into a Stationery pad from the command line?

You can do it by clicking "Get info" on a file and checking the box, but I would like to do it without clicking.

Get Info dialog

An AppleScript solution would be useful also, but GUI scripting is off limits.

2 Answers 2

2

The SetFile utility is provided with Xcode, which Apple distributes at no cost. Once you have installed Xcode, you can issue the command

SetFile -a T /path/to/foo.bar
0
2

After failing to find a non-AppleScript way to do this, I bit the bullet.

The AppleScript:

 tell application "Finder" to set stationery of ¬
   (POSIX file "/path/to/foo.bar" as alias) to true

You can run this from the command line using

osascript -e command

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .