Has no one come up with a method to randomize OSX’s alert sound?
I’d like to have the alert alternate between a batch of my own AIFFs.
The goal would be to make the alert surprising. (you tune it out if you hear the same one over and over)
Maybe every five minutes just change what sys prefs has as its alert?
(though It sounds like scripting sys prefs is no picnic)
I had one idea where I would name all of the different AIFFs with the same name (and store them in subfolders) and then every so often have one of them overwrite the one in /System/Library/Sounds. But that seems clunky.
--assuming "Frog" is your default sound
set ifolder to "Leopard:System:Library:Sounds:"
set ifile to "Leopard:System:Library:Sounds:Frog.aiff"
tell application "Finder" to set name of file ifile to "Frog2.aiff"
tell application "Finder"
set thelist to every file in folder ifolder
set rn to random number from 1 to 10
set namex to name of item rn in thelist
set name of item rn in thelist to "Frog.aiff"
set name of file ifile to namex
end tell
my idea was this but renaming fails because of permissions problem. You have to use do shell script and “administrator privileges”.
set ifile to "Leopard:System:Library:Sounds:Frog.aiff"
set ifile2 to "Leopard:System:Library:Sounds:Frog2.aiff"
set ifile to quoted form of (POSIX path of ifile)
set ifile2 to quoted form of (POSIX path of ifile2)
set thecmd to "mv " & ifile & " " & ifile2
do shell script thecmd with administrator privileges
the idea is to choose a certain sound in system preferences and rename randomly all desired sounds to that name.
The privileges issue is no problem if you put your sounds in ~/Library/Sounds.
I’d prefer to use the cp command, which copies the files and keeps the originals untouched
no problem.
Immagine you have three sounds: s1, s2, s3.
Duplicate s1 and name it s4
Choose s4 as alert sound.
Duplicate s2 to s4 with replacing
Duplicate s3 to s4 with replacing
etc.