When I run my code, the list pops up and I make a selection, but nothing happens.
My code:
My code:
Code:
set showOrHide to choose from list {"Show system files", "Hide system files"} with prompt "Please make your selection" without multiple selections allowed and empty selection allowed
return the result as string
if showOrHide is false then
error number -128
else if showOrHide contains "Show system files" then
set userChose to "Show system files" as text
else if showOrHide contains "Hide system files" then
set userChose to "Hide system files" as text
end if
if userChose is "Show system files" then
do shell script "defaults write com.apple.finder AppleShowAllFiles YES"
else if userChose is "Hide system files" then
do shell script "defaults write com.apple.finder AppleShowAllFiles NO"
end if