I am frequently switching between school computers and have a preference to have the hidden files shown, however, not everyone does. Normally I use the
"defaults write com.apple.finder AppleShowAllFiles -bool true"
command, however, it would be very convenient if I could just run some Applescript, instead of manually copying the text into the Terminal and then redoing this when I'm done. So what I am trying to accomplish is the receive user input as to whether they want to show all files or not and then run that command. Doing some initial research on Applescript I was able to figure out some basic idea of how I would structure it. The below code is wrong, so please excuse by noob mistakes.
(choose from list {"Hide", "Show"} ¬
with prompt "Do you want to hide or show hidden files?")
if "Hide" then
do shell script "defaults write com.apple.finder AppleShowAllFiles -bool False"
else
do shell script "defaults write com.apple.finder AppleShowAllFiles -bool True"
end
I can get up to the user dialogue box, however, when I try and input a choice, it replies: "Can’t make "Hide" into type boolean.". If someone could help me out show me what I need to change then that would be greatly appreciated.
Thanks, Michael.