MacOS – Toggling a file’s “hidden” status

automatorcommand linemacos

Using Automator, I want to be able to toggle a folder or file's "hidden" status. How is this possible through the command line? (I'm giving the file's directory to the script via a variable.)

Best Answer

chflags hidden /path/to/file

See also: http://osxdaily.com/2012/07/19/hide-file-mac-os-x-chflags/