|
|
A script to keep iCal's dock icon current
I really like AppleScript and have used it for years - but speedwise, when you put an Applescript up against a shell script - the shell script is just much faster. I try to do all my scripting in the shell - sometimes more succesful than others. Here's the same thing as above in a shell script
#!/bin/sh
#
# Name: fix-ical
# Launches ical and immediately quits to aid
# in fixing the stuck dock icon
#
# Save this script as "fix-ical" in you ~/Library/bin
# change permissions to executable
# Set to run from a cron task
#
# the script is set to pause 10 secs after launching ical
# this can be adjusted to taste per your machine
/Applications/iCal.app/Contents/MacOS/iCal &
sleep 10
ps -ax | grep iCal | grep -v grep | awk '{print $1}' | xargs kill -9
is the kill -9 necessary?
I was under the impression one should try to avoid kill -9'ing a process if a regular kill command would work. Does iCal not respond to a simple kill signal? Just curious.
is the kill -9 necessary?
Good point and I actually thought of that as soon as I posted it. It might be better to use a kill -3 (quit) or kill -15 (terminate). I tried uisng kill -3 and it had no effect - but kill -15 worked fine. Does anyone know the pros and cons of doing a kill -15 on a running app?
Kill -15 is clean
kill -15 (SIGTERM) is the default signal sent by the kill program, allowing the program to do a clean exit, save its state, data and so on.
Kill -15 is clean
i get a mail from the cron daemon saying:
i'd hate to have a new one each day...
A script to keep iCal's dock icon current
This script is working, teh icon is changing, BUT it is reverting BACK to the old number soon after. Wonder where that info is stored. |
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.14 seconds |
|