How to bounce an application with Applescript
Say, for whatever reason, you want to bounce iphoto once an hour. You can do that with AppleScript and cron.
Copy this into ~/bin/bounce-iphoto:
#!/usr/bin/osascript
on appIsRunning(appName)
tell application "System Events" to (name of processes) contains appName
end appIsRunning
if appIsRunning("iPhoto") then
tell application "iPhoto" to quit
delay 60
tell application "iPhoto" to run
end if
Then wire it up with cron:
chmod 755 ~/bin/bounce-iphoto crontab -e
and add this line to your crontab (which may be empty):
0 * * * * $HOME/bin/bounce-iphoto
Related posts:
- How to delete an iPhone application
Click the home button, flick to the page that has the icon of the application or bookmark that you want to remove, and then tap and hold for a...... - Maildir auto-archive
If you’ve got your mail sitting on some server and in Maildir format, and you’ve used Outlook’s “Auto Archive” feature, you might wish that your inbox (and subdirectory contents)...... - OpenDNS updater for linux/ubuntu
The OpenDNS service is great — it provides anti-phishing and the ability to filter out some of the less desirable detritus from the internets. OpenDNS needs to be periodically notified...... - Accessing git over ssh on a non-standard port
Simple ssh access to a git repo can be sufficient for a small dev team–but what if you’re using a non-standard ssh port? The solution–do as Linus says. Use ~/.ssh/config.......