Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • Strictly speaking, it's an alias, not a file. Here's how to use the AppleScript from the command line: on run argv [newline] tell application "Finder" to set extension hidden of (POSIX file (first item of argv) as alias) to true [newline] end run, use as osascript filename.scpt targetfile. Commented Mar 12, 2012 at 21:45
  • 1
    You're right, of course. I added the full AppleScript event. In the future, just go ahead and add anything important to the answer – you're always welcome to. Commented Mar 12, 2012 at 21:50
  • 1
    just what I was looking for.. thankfully I have Xcode installed and SetFile did the trick :-) Commented Oct 2, 2013 at 13:42
  • SetFile is deprecated since Xcode 6. Also the link to manual page has expired. Commented Nov 8, 2018 at 5:25
  • 1
    SetFile is deprecated as noted, but it's still present on Catalina. Using it worked well enough for me today. Commented Jan 28, 2021 at 9:42