• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: system alerts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: FASTEST Record Find with FileMaker Pro 7?
  • Next by Date: Xmail
  • Previous by thread: Re: system alerts
  • Next by thread: Folder Action to create Archive
  • Index(es):
    • Date
    • Thread