not enough documentation
Umm...Welcome to Automator - Apple Support
This is also a great link
There is so many different ways of doing what you want.
Option A: Shell Script (Does in background)
Option B: Open Terminal Window
A
Option 1: Pure AppleScript (Using /Applications/Utilities/Script Editor.app
)
do shell script "defaults write com.apple.finder AppleShowAllFiles YES"
Option 2: Pure Automator

Option 3: Automator + AppleScript

B
Option 1: Pure AppleScript
tell application "Terminal"
activate
do script "defaults write com.apple.finder AppleShowAllFiles YES"
end tell
Option 2: Automator + AppleScript
(A3 with the in B1)
For the toggle hears the AppleScript Code to be used in any option of your choosing:
set a to (do shell script "defaults read com.apple.finder AppleShowAllFiles")
if a is "YES" then
do shell script "defaults write com.apple.finder AppleShowAllFiles NO"
else
do shell script "defaults write com.apple.finder AppleShowAllFiles YES"
end if
Export Options
Script Editor:
File>Export
Automator:
Choose Application when creating a new document
