title: Javascript for Automation not launching correct application
body: <p>I'm trying to write an automation Javascript to test my app's AppleScript functionality. I want it to launch my dev build, so I started off like so:</p>
  
  <pre><code>my_app = Application('/Users/Dov/Library/Developer/Xcode/DerivedData/MyApp-efmlzhsvapzuwcfqxjxhhuncpogy/Build/Products/Debug/MyApp.app')
  </code></pre>
  
  <p>When I run the script, it launches another build in a totally different directory. However, the following AppleScript <em>does</em> launch the intended dev build:</p>
  
  <pre><code>tell application "/Users/Dov/Library/Developer/Xcode/DerivedData/MyApp-efmlzhsvapzuwcfqxjxhhuncpogy/Build/Products/Debug/MyApp.app"
      activate
  end tell
  </code></pre>
  
  <p>Shouldn't these both behave the same way? And how/why would it look for another app with the same Bundle ID? <a href="https://developer.apple.com/library/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/#//apple_ref/doc/uid/TP40014508-CH109-SW6" rel="nofollow">This documentation</a> says my Javascript syntax should work:</p>
  
  <blockquote>
    <p><strong>Accessing Applications</strong></p>
    
    <p>Applications can be accessed in these ways:</p>
    
    <ol>
    <li><p>Name</p>
    
    <p><code>Application('Mail')</code></p></li>
    <li><p>Bundle ID</p>
    
    <p><code>Application('com.apple.mail')</code></p></li>
    <li><p>Path</p>
    
    <p><code>Application('/Applications/Mail.app')</code></p></li>
    </ol>
    
    <p><code>...</code></p>
  </blockquote>