title: How to create an Applescript to execute terminal commands and password
body: <p>I've searched around but couldn't quite find anything to fit my problem.</p>
  
  <p>I want to create a script to replicate the following:</p>
  
  <ol>
  <li><p>Open Terminal</p></li>
  <li><p>Execute the following command:</p>
  
  <pre><code>sudo kextunload /System/Library/Extensions/AppleHDA.kext
  </code></pre></li>
  <li><p>Then have it enter my OSX admin password for me.</p></li>
  <li><p>Then execute the following:</p>
  
  <pre><code>sudo kextload /System/Library/Extensions/AppleHDA.kext
  </code></pre></li>
  </ol>
  
  <p>I'm completely new to applescript, so hoping someone can help me out.</p>
  
  <p>Thanks!</p>