title: Terminal scripting in OSX
body: <p>I've never created a script before and am looking for a tutorial on writing a script for OSX 10.6.  There is a terminal command that can show all hidden files. It's</p>
  
  <pre><code>defaults write com.apple.finder AppleShowAllFiles TRUE
  killall Finder
  </code></pre>
  
  <p>Changing TRUE to FALSE will hide system files.  I want to make a script that checks the value of AppleShowAllFiles, and if TRUE, writes FALSE, and if FALSE, writes TRUE.  </p>
  
  <p>Is this done in TextEdit and saved as a .sh file?  Can a script be something I double-click that just runs, or do I have to start terminal and type a command to execute the script? I'm a newb, sorry</p>
  
  <p>Thanks guys</p>