title: How to get the process id (PID) of an app launched using `open` command on OSX?
body: <p>I've launched an application via the <code>open</code> command on the OSX command line like so:</p>
  
  <pre><code>open -a "/Applications/Adobe After Effects CC/Adobe After Effects CC.app"
  </code></pre>
  
  <p>I want to get the process id of that launched application.  Is there any way to do this reliably on OSX?  It doesn't seem <code>open</code> returns anything, so I'm not sure I can even pipe its result into something like <code>ps</code> to perform a <code>grep</code> operation.  I thought that maybe since the app is launched via the terminal I would know which app is the <code>frontmost</code>, but am doubting the reliability of that solution. Any ideas?</p>