title: Applescript path to application using variable
body: <p>If I have an applescript snippet such as this</p>
  
  <pre><code>tell application "Finder"
  set thePath to (POSIX path of (path to application "MyApp"))
  end tell
  </code></pre>
  
  <p>it will return to me</p>
  
  <p>"/Applications/MyApp.app"</p>
  
  <p>Now, what I can't seem to figure out is how to instead specify "MyApp" via a variable rather than the literal.  </p>
  
  <p>My applescript reads in some XML values, one of them being the name of the application I'm interesting in.  I've tried this:</p>
  
  <pre><code>tell application "Finder"
  set thePath to (POSIX path of (path to application someVariable))
  end tell
  </code></pre>
  
  <p>but this simply tells me the error</p>
  
  <p>"Finder got an error:  Can't make application "MyApp" into type constant."</p>
  
  <p>Any ideas how I can do this?</p>