title: Passing Variables to another Applescript Application
body: <p>I have found a few things on how to run another applescript application but not on giving it an input. On applescript site I found this:</p>
  
  <pre><code>tell application "NonStayOpen"
    launch
    stringTest("Some example text.")
  end tell
  </code></pre>
  
  <p>Which would be a solution, I just rap the script in a handler and pass my variable. But not matter what I do I can not get the handler to activate.</p>
  
  <p><strong>Ideal Situation</strong>
  run script that contains the following:</p>
  
  <pre><code>tell application id "com.apple.testhandlerApp"
    TestHandler("Hi") --Or if I can get the Open(SomeVar) to work
  end tell
  </code></pre>
  
  <p>which then activates application testhandlerApp containing the script:</p>
  
  <pre><code>on TestHandler(somevar)
      set contentText to somevar as string
      display dialog contentText
  end TestHandler
  </code></pre>
  
  <p>Giving me a dialog saying "Hi". Reason being is I want to put the first bit of code into automator to runs a complex application that takes a text input. Right now all I get is "Connection is invalid." If I didn't need the input it seems using activate works fine.</p>