title: Applescript: number list of words according to their occurrence in the sequence
body: <p>So I have this list of words:</p>
  
  <pre><code>{"It", "was", "the", "best", "of", "times", "it", "was", "the", "worst", "of", "times", "it", "was", "the", "age", "of", "wisdom", "it", "was", "the", "age", "of", "foolishness", "it", "was", "the", "epoch", "of", "belief"}
  </code></pre>
  
  <p>I'd like each occurrence of a word to be numbered according to the number of times it has occurred in the sequence:</p>
  
  <pre><code>{"It", 1}, {"was", 1}, {"the", 1}, {"best", 1}, {"of", 1}, {"times", 1} {"it", 2}, {"was", 2}, {"the", 2}, {"worst", 1}, {"of", 2}, {"times", 2}, {"it", 3}, {"was", 3}, {"the", 3}, {"age", 1}, {"of", 3}, {"wisdom", 1}, {"it", 4}, {"was", 4}, {"the", 4}, etc.
  </code></pre>
  
  <p>Any help would be greatly appreciated. </p>