Automator script to hide files gives "if: command not found" error
I am following the website https://www.lifewire.com/create-menu-item-to-show-hidden-files-2260155 to create a menue option that automatically hide and show fodlers and files.
I follow the instructions and copy the script. There seems to be some whitespace missing, which I insert. I end up with the code:
STATUS=`defaults read com.apple.finder AppleShowAllFiles` if [$STATUS == 1] then defaults write com.apple.finder AppleShowAllFiles -boolean FALSE else defaults write com.apple.finder AppleShowAllFiles -boolean TRUE fi killall Finder
I then find a folder I wish to hide, and choose it from the appropriate options, I then get this error (its in norwegain, but the top line translates to: "This error happened when trying to perform the action "Perform shell-procedure"":
Følgende feil oppsto under utføring av handlingen «Utfør shell-prosedyre»: «2019-07-18 12:06:00.516 defaults[6785:962964]
The domain/default pair of (com.apple.finder, AppleShowAllFiles) does not exist
-: if: command not found»
MacBook Air 13", macOS 10.14