Re: system alerts
Re: system alerts
- Subject: Re: system alerts
- From: kai <email@hidden>
- Date: Sat, 12 Mar 2005 03:20:13 +0000
On Fri, 11 Mar 2005 09:58:14 +0100, wayne melrose wrote:
Roy,
My suggestion would be to use GUI scripting..
I have used it a little and found it to be very useful.
Apple have a good explaination and instructions along with sample code
at this address..
http://www.apple.com/applescript/uiscripting/index.html
Wayne Melrose
On Mar 11, 2005, at 5:09 AM, Roy Whelden wrote:
Hello!
Does anyone know an easy way to change system alerts (beep, ping,
etc) using Applescript?
Thanks in advance,
Roy Whelden
If it helps to have a GUI scripting example that focuses specifically
on sounds, you might like to play around with this one (as usual, watch
out for line wraps):
-------------
to chooseSound from soundList instead of currSound
tell (choose from list soundList with prompt "Please choose an alert
sound:" default items currSound)
if it is false or it is currSound then error number -128
item 1
end tell
end chooseSound
to setupWindow()
tell application "System Preferences"
if (count (windows whose name does not start with "<<")) is 0 then run
set current pane to pane "com.apple.preference.sound"
tell window "Sound" to set miniaturized to true
end tell
end setupWindow
to switchSound()
tell application "System Events" to tell process "System Preferences"
if not (exists) then run application "System Preferences"
my setupWindow()
tell tab group 1 of window "Sound"
click radio button "Sound Effects"
tell table 1 of scroll area 1
tell text field 1 of rows to set soundList to value
tell text field 1 of (first row whose selected is true) to set
currSound to {value}
set newSound to my (chooseSound from soundList instead of currSound)
select (first row whose value of text field 1 is newSound)
end tell
end tell
end tell
end switchSound
switchSound()
-------------
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden