title: Applescript dialog in InDesign CS6: how to restrict number ranges in inputs?
body: <p>I have an applescript dialog for InDesign CS6 that returns values entered into three text fields. Here's the relevant snippet</p>
  
  <pre><code>set userResponse to show myDialog
  if userResponse is true then
      set docWidth to edit contents of myWidth as string
      set docHeight to edit contents of myHeight as string
      set docBleed to edit contents of myBleed as string
      destroy myDialog
  else
      destroy myDialog
      error number -128
  end if
  </code></pre>
  
  <p>I want to add the following logic and prevent the user from entering in values larger than 2160. I just want this dialog to display and then return to the previous dialog so they can correct the error:</p>
  
  <pre><code>if 2160 &lt; docWidth or docHeight then
      beep 1
      display alert "Document cannot be larger than 2160 inches in either dimension." buttons ["Try again"] default button 1
  end if
  </code></pre>
  
  <p>I can't find a way to insert this into the previous dialog without destroying it. Any ideas?</p>