20. Clock Chime
This document explains how to make a clock chime.



(Trigger)
1. Schedule
Set "0" at field of minute and left other fields empty. Then the task is executed on 0 minute of each hour.




2. Schedule (Optional)
If the task should be executed at 30 minutes of every hour, set "30" at field of minute and left other fields empty.




3. Hot key (Optional)
If a hot key trigger is set, the user can listen the chime anytime.





(Action)
1. AppleScript
With AppleScript, let Mac say the current time.
set theHour to (time of (current date)) div hours set theMinute to ((time of (current date)) mod hours) div minutes if theMinute is 0 then set theMinute to "O'clock" if theHour > 12 then set theHour to theHour - 12 if theHour is 0 then set theHour to 12 say "It's " & theHour & " " & theMinute & " now." using "Alex"





2. AppleScript (Optional)
If you have a good bell or chime sound, it can be played as a chime too. Unfortunately AppleScript itself doesn't have an ability to play a sound, so please download "Play Sound" a helper application to play sound from Microcosm software. Then make an AppleScript action and copy following script. The path at 5th line should be changed to appropriate path to your sound file.
set theHour to (time of (current date)) div hours if theHour > 12 then set theHour to theHour - 12 if theHour is 0 then set theHour to 12 set sound_file to POSIX file "/Users/sekn/Music/bell.wav" as alias tell application "Play Sound" play sound_file repeat theHour - 1 end tell

 

To Top and Map