Hi,
   I have written a small menulet application and is running as a LaunchAgent. The problem that i am facing is while installing my app and in situation when multiple Users are logged in,

 
          # Launch Menulet for all the logged in Users
          for userName in `/usr/bin/users`
          do
                  echo "Loading Menulet for $userName"
                  su -l $userName -c "launchctl load -S Aqua /Library/LaunchAgents/com.myname.menulet.plist"
          done     

Now in a situation where i have opened the Terminal and logged in root, the  /usr/bin/users would now show as 2 users logged in and i would try to launch my app in the roots context as well. Hence i am getting 2 Menulets with the same User.

How can i solve this problem? Please help ...


thanks in advance
~Arjun