title: Launchd PLIST Not Running
body: <p>I am attempting to run an Applescript inside a launchd plist, but for some reason it just isn't working.  It could be that it is my computer, but I am thinking that there may be something else wrong with it.  If someone could take a look and comment on this post, I would really appreciate it!</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
  &lt;dict&gt;
  &lt;key&gt;Label&lt;/key&gt;
  &lt;string&gt;com.pf.Testing&lt;/string&gt;
  &lt;key&gt;ProgramArguments&lt;/key&gt;
  &lt;array&gt;
  &lt;string&gt;/usr/bin/osascript&lt;/string&gt;
  &lt;string&gt;-e&lt;/string&gt;
  &lt;string&gt;'tell application "Finder"' -e  'set didQuit to (path to home folder as string) &amp;amp; ".myApp"' -e 'if (exists file didQuit) then' -e 'tell application "TestApp"' -e 'activate' -e 'end tell' -e 'end if' -e 'end tell'&lt;/string&gt;
  &lt;/array&gt;
  &lt;key&gt;StartInterval&lt;/key&gt;
  &lt;integer&gt;20&lt;/integer&gt;
  &lt;key&gt;RunAtLoad&lt;/key&gt;
  &lt;true/&gt;
  &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p>Thanks for any help!</p>
  
  <p><strong>LATEST PLIST:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
  &lt;dict&gt;
  &lt;key&gt;Label&lt;/key&gt;
  &lt;string&gt;com.pf.Testing&lt;/string&gt;
  &lt;key&gt;ProgramArguments&lt;/key&gt;
  &lt;array&gt;
  &lt;string&gt;/usr/bin/osascript&lt;/string&gt;
  &lt;string&gt;-e&lt;/string&gt;
  &lt;string&gt;'tell application "Finder"'&lt;/string&gt;
  &lt;string&gt;-e&lt;/string&gt;
  &lt;string&gt;'set didQuit to (path to home folder as string) &amp;amp; ".myApp"'&lt;/string&gt;
  &lt;string&gt;-e&lt;/string&gt;
  &lt;string&gt;'if (exists file didQuit) then'&lt;/string&gt;
  &lt;string&gt;-e&lt;/string&gt;
  &lt;string&gt;'tell application "TestApp"'&lt;/string&gt;
  &lt;string&gt;-e&lt;/string&gt;
  &lt;string&gt;'activate'&lt;/string&gt;
  &lt;string&gt;-e&lt;/string&gt;
  &lt;string&gt;'end tell'&lt;/string&gt;
  &lt;string&gt;-e&lt;/string&gt;
  &lt;string&gt;'end if'&lt;/string&gt;
  &lt;string&gt;-e&lt;/string&gt;
  &lt;string&gt;'end tell'&lt;/string&gt;
  &lt;/array&gt;
  &lt;key&gt;StandardErrorPath&lt;/key&gt;
  &lt;string&gt;/Users/pf/Desktop/Problem.log&lt;/string&gt;
  &lt;key&gt;StartInterval&lt;/key&gt;
  &lt;integer&gt;20&lt;/integer&gt;
  &lt;key&gt;RunAtLoad&lt;/key&gt;
  &lt;true/&gt;
  &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>