title: Repeat function if variable is changed?
body: <p>Having trouble figuring out this loop - I want the below function to repeat ONLY if myText changes (i.e. the album the individual is listening to changes) - I have been able to make it loop a certain number of times or repeat in the event the track changes, but I want it to repeat in the event the album changes. </p>
  
  <pre><code>tell application "iTunes"
  repeat if myText changes
  if player state is playing then
      set albumName to (get album of current track)
      set myText to text 1 thru 10 of albumName
  end if
  end repeat
  end tell
  
  open location "http://bandsite.com/shows/" &amp; myText
  </code></pre>
  
  <p>When the code works without the repeat command it looks like this: </p>
  
  <pre><code>tell application "iTunes"
  if player state is playing then
  set albumName to (get album of current track)
  set myText to text 1 thru 10 of albumName
  end if
  end tell
  
  open location "http://bandsite.com/shows/" &amp; myText 
  </code></pre>
  
  <p>I need the whole function to repeat in the event myText changes</p>