title: Print to Stdout with applescript
body: <p>I'm trying to run an AppleScript script from the terminal, however I can't get it to print anything by calling </p>
  
  <pre><code> osascript myFile.scpt "/path/to/a/file"
  </code></pre>
  
  <p>I'm trying:</p>
  
  <pre><code>on run fileName
  
  set unique_songs to paragraphs of (read POSIX file fileName)
  
  repeat with nextLine in unique_songs
      if length of nextLine is greater than 0 then
          set AppleScript's text item delimiters to tab
          set song to text item 2 of nextLine
          set artist to text item 3 of nextLine
          set album to text item 4 of nextLine
  
          set output to ("Song: " &amp; song &amp; " - " &amp; artist &amp; " - " &amp; album)
          copy output to stdout
      end if
  end repeat
  end run
  </code></pre>
  
  <p>The tab delimited file is formatted something like this:</p>
  
  <pre><code>1282622675  Beneath the Balcony Iron &amp; Wine The Sea &amp; the Rhythm    
  1282622410  There Goes the Fear Doves   (500) Days of Summer        
  1282622204  Go to Sleep. (Little Man Being Erased.) Radiohead   Hail to the Thief
  </code></pre>
  
  <p>Tabs aren't really showing up well on this :(</p>