[launchd-dev] run gui LaunchAgent from launchd

Bob Kells bobkells at steelcape.com
Fri Dec 14 16:51:20 PST 2007


Thanks for getting back to me.
Here is some info about the plist.
I had to cut the app gui-calls as the message was too big.
It feels like I am missing something obvious...bob


I have been running a cocoa-app with a simple gui two different ways.
1. Run from a script file at the cmd-line.
     This runs fine.  I check various fields by tailing the system.log.
     The alert panels appear as I expect.
2. Run by the same script file, which is run by launchd.
     The app is recognized and starts up.
     I can see the same fields in the tailed system log.
     The app run ok until it hangs in the call to [oAlert runModal];

I also try to run the app directly from launchd.
I get the same effect as in #2 above.

Here is the launchd plist.
It is located in ~/Library/LaunchAgents.
I cd here to issue all the launchctl calls.
I have tried various permutations, such as the full path in the  
Program-key value.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http:// 
www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
         <key>Disabled</key>
         <true/>
         <key>Label</key>
         <string>net.aquaconnect.acnotify</string>
         <key>OnDemand</key>
         <true/>
         <key>Program</key>
         <string>ACNotify</string>
         <key>ProgramArguments</key>
         <array>
                 <string>/Users/bob/AppSupport/ACNotify.app/Contents/ 
MacOS/ACNotify</string>
                 <string>-d</string>
                 <string>4</string>
                 <string>-p</string>
                 <string>/Users/bob/LaunchScriptTest</string>
         </array>
         <key>QueueDirectories</key>
         <array>
                 <string>/Users/bob/LaunchScriptTest</string>
         </array>
         <key>ServiceDescription</key>
         <string>Aquaconnect Alert Notification Manager</string>
         <key>WorkingDirectory</key>
         <string>/Users/bob/AppSupport/ACNotify.app/Contents/MacOS</ 
string>
</dict>
</plist>


On Dec 14, 2007, at 3:30 PM, James Bucanek wrote:

> bobkells at steelcape.com <mailto:bobkells at steelcape.com> wrote  
> (Friday, December 14, 2007 3:13 PM -0800):
>
>> Not having any luck running a LaunchAgent containing a gui from  
>> launchd.
>> Is this simply not possible?
>
> I'm running both GUI and non-GUI agents (~/Library/LaunchAgents)  
> using launchd.
>
> Try telling us what your .plist contains and describe the problems  
> your having.
>
> -- 
> James Bucanek
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-dev/attachments/20071214/59dd02e4/attachment-0001.html


More information about the launchd-dev mailing list