title: Get process name from application name and vice versa, using Applescript
body: <p>On 27 February 2003, Apple employee Christopher Nebel said he'd like to straighten out <a href="http://lists.apple.com/archives/Applescript-implementors/2003/Feb/msg00054.html" rel="noreferrer">this problem</a> as reported by Bill Cheeseman:</p>
  
  <blockquote>
    <p>Because of the different naming for applications and application
    processes in some circumstances, we end up having to write slightly
    confusing scripts like this (if we've renamed Adobe Photoshop 7.0 to
    "Photoshop" in the Finder):</p>
  
  <pre><code>tell application "Photoshop" to activate
  tell application "System Events"
  tell application process "Adobe Photoshop 7.0"
  </code></pre>
  </blockquote>
  
  <p>Suffice it to say, it's still a problem in August 2011, and I keep running into it, so I hope the good folks here at StackOverflow can help find a workaround; thanks in advance!</p>
  
  <p>Given an application name (i.e. something I can instruct to <code>activate</code>), I'd like to be able to pass that name to a subroutine to find the corresponding process name. Conversely, given a process name, I'd like to be able to pass it to a subroutine to find the corresponding application name.</p>
  
  <p>Any suggestions?</p>