|
|
used launchd for ichatlocationscript and works fine
i configured launchd to periodically run an applescript that changes the ichatstatus to my current network-location. it works fine. i made this plist-file in ~/Library/LaunchAgents :
it is labeled "iChatLocation", runs with low IO priority and with nice 10, starts an applescript in the bin-folder in my homedir, runs at load (maybe i wouldn't need that) and then every 180 seconds with my (niko) userrights.
even better of course would be, if s/o figured out how to run stuff at network-changes.
i started it with:
Nikomat:~ niko$ launchctl load Library/LaunchAgents/iChatLocation.plisti can check, that its running: Nikomat:~ niko$ launchctl list iChatLocation Nikomat:~ niko$
configd better than launchd
The way you run stuff at network switches rather than periodically is to hook into configd, not launchd. See here for details.
configd better than launchd / right...
...but when i think about it... perhaps in my case its better to run stuff periodically as the script exits anyway if nothing has changed AND more important it relies on ichat having logged in... which usually isn't the case immediatelly after the networkchange, but some 10 seconds later...
used launchd for ichatlocationscript and works fine
You actually don't need to set the user explicitly if you put it in your own ~/Library/LaunchAgents directory. The default is to run as the user that added the agent to launchd. One thing I can't figure out is how to run commands with spaces in the name. I've tried quoting, no quoting, and backslash escaping, but nothing seems to work --- |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.05 seconds |
|