title: AppleScript to click OK and save file from Firefox link
body: <p>So I have a page with about 60 of links on it, with random URL's, each one needs to be clicked and downloaded individually.</p>
  
  <p>I'm working on the fundamental script to tab over to the next link, hit enter, and then 'ok' to download to desktop.</p>
  
  <p>I'm new, but I cannot seem to get the 'floating' window which pops up, to let me keystroke 'return' or click on 'OK'. I'm looking to save the file to desktop, but I can't seem to reference the window by title in the app, or guess the index number or window ID.</p>
  
  <p>Any help is much appreciated..</p>
  
  <p>I've also seen the dictionary, in script editor, and many of the properties of 'window' for Firefox, throw syntax and other errors.</p>
  
  <pre><code>tell application "System Events"
  tell application "Firefox" to activate
  tell window "$thewindowtitle"
      keystroke tab
      delay 1.0
      keystroke return
  end tell
  tell application "Firefox"
      tell window visible
      click button "OK"
      end tell
  end tell
  end tell
  end tell
  </code></pre>
  
  <p>Thanks!</p>