title: Simple Apple Automator iterator not working (using AppleScript) - why?
body: <p>I'm trying to do the simplest thing in the world - a basic iterator in Automator. The workflow goes:</p>
  
  <p>Get Value of a Variable (initially set to 1)</p>
  
  <p>Run Applescript:</p>
  
  <pre><code>on run {input, parameters}
      set input to input + 1
      return input
  end run
  </code></pre>
  
  <p>Set Value of a Variable</p>
  
  <p>Loop</p>
  
  <p>It works the first time, moving from 1 up to 2 as expected. But it fails on the second pass, giving the error </p>
  
  <blockquote>
    <p>Can't make {} into type number. (-1700)</p>
  </blockquote>
  
  <p>I'm clueless as to why - I've tried getting it to output from the Applescript as an integer and it makes no difference. Can anyone shed some light?</p>