title: How to use AppleScript or Lua to do an ALT + TAB after results on the Calculator.app
body: <p>I use the Calculator.app, and after hitting the <kbd>ENTER</kbd> key, I would like it to automatically do an <kbd>ALT</kbd> + <kbd>TAB</kbd> to go to the previous App I was using: Excel or Firefox or Chrome, ... you name it.</p>
  <p>I have the same question for just .lua, but if it can't be done with .lua I'd like to do it with AppleScript or with the Automator.</p>
  <p><a href="https://stackoverflow.com/questions/70142261/whats-the-hot-key-for-tab-in-hammerspoon">What&#39;s the hot key for TAB in .lua? hammerspoon?</a></p>
  <p><strong>UPDATE:</strong></p>
  <p>As user3439894 says, <kbd>CMD</kbd> + <kbd>TAB</kbd> works fine.</p>
  <p>But in my end, the <kbd>TAB</kbd> is not released, therefore, I keeps on showing all the open apps. So, I tried to put a <kbd>RETURN</kbd> as of the documentation. I also tried <kbd>ENTER</kbd> , but non of them work.</p>
  <pre><code>hs.eventtap.keyStroke({&quot;cmd&quot;}, &quot;tab&quot;)
  hs.eventtap.keyStroke({&quot;return&quot;})
  -- hs.eventtap.keyStroke({&quot;enter&quot;})
  </code></pre>