Re: Mute not scriptable?
Re: Mute not scriptable?
- Subject: Re: Mute not scriptable?
- From: Robert Poland <email@hidden>
- Date: Mon, 19 Jan 2004 21:28:24 -0700
Since the repeat loop is redundant I never caught the error. However
the main issue is that "Mute" doesn't appear to be scriptable, with
or without the repeat loop.
Thanks,
Your repeat loop structure is incorrect. Even if the idea behind your code
is correct, I wouldn't expect this to work.
For example, your script says:
click
repeat until value is 1
end repeat
This will click the checkbox, then repeat indefinitely (assuming 'value'
isn't 1)
With a repeat loop, everything between the 'repeat' and the 'end repeat' is
run until the test condition is true. Since you have nothing between these
two statements, your code will be stuck in an infinite loop.
You need to restructure your repeat loops so that the commands you want to
repeat are between the 'repeat' and 'end repeat' statements:
repeat until value is 1
click
end repeat
It may or may not solve your particular problem, but at least the repeat
loops won't lock up your script.
Andrew
:)
On 1/19/04 9:14 AM, "Robert Poland" <email@hidden> wrote:
Hi,
I'm trying to run this script, with little success.
----
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.sound"
end tell
tell application "System Events" to tell process "System Preferences"
to tell window 1 -- to tell tab group 1
tell checkbox "Show volume in menu bar" to if value is 0 then
click
repeat until value is 1
end repeat
end if
tell checkbox "Mute" to if value is 1 then
click
repeat until value is 0
end repeat
end if
end tell
----
tell checkbox "Show volume in menu bar" works fine but tell checkbox
"Mute" gives the error; "System Events got an error:
NSRecieverEvaluationScriptError: 4"
System Preferences dictionary was no help.
Command "set soundVolume to N" doesn't override Mute.
iMac FP 800, OS 10.3.2.
Tia,
--
Bob Poland - Englewood, CO
http://www.ibrb.org/
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.