title: Applescript launching of Spotlight?
body: <p>I tried to use the following to open the Spotlight search box:</p>
  
  <pre><code>tell application "System Events"
      keystroke " " using {command down}
  end tell
  </code></pre>
  
  <p>It simply tries to issue command-space. It does work, but if I save the script as an Application and run it, the Spotlight window shows up and then promptly disappears afterwards.</p>
  
  <p>Why does this happen and what can I do to keep the Spotlight window open?</p>
  
  <p>Alternatively: <strong>How do I open the Spotlight search box using Applescript?</strong></p>