on toggleErrorsEmailList:sender
try
set temp to sender's title() as text
if temp is "Display only Errors Emails List" as text then
if runForOz then say "setting red"
set my errorsListVisible to true
set p to 1
set myFont to current application's NSFont's fontWithName:"System Bold Regular" |size|:13 # Regular Bold
set p to 2
set AppleColors to current application's NSColorList's colorListNamed:"Apple"
set p to 3
set someColor to AppleColors's colorWithKey:"Red"
set p to 4
set attrsDict to current application's NSDictionary's dictionaryWithObjects:{myFont, someColor} forKeys:{current application's NSFontAttributeName, current application's NSForegroundColorAttributeName}
set p to 6
tell current application's NSAttributedString to set replacementText to alloc()'s initWithString:"Hide Errors Emails List" attributes:attrsDict
set p to 7
displayErrorsEmailsButton's setAttributedTitle:replacementText
# sender's setTitle:replacementText # "Hide Errors Emails List"
say 7 — < works, no errors here
else
set my errorsListVisible to false
set p to 8
set myFont to current application's NSFont's fontWithName:"System Regular" |size|:13 # Regular
set p to 9
set AppleColors to current application's NSColorList's colorListNamed:"Apple"
set p to 10
set someColor to AppleColors's colorWithKey:"Black"
set p to 11
set attrsDict to current application's NSDictionary's dictionaryWithObjects:{myFont, someColor} forKeys:{current application's NSFontAttributeName, current application's NSForegroundColorAttributeName}
set p to 12
tell current application's NSAttributedString to set replacementText to alloc()'s initWithString:"Display only Errors Emails List" attributes:attrsDict
set p to 13
displayErrorsEmailsButton's setAttributedTitle:replacementText
# sender's setTitle:replacementText # "Display only Errors Emails List"
# sender's setTitle:"Display only Errors Emails List"
end if
on error errmsg
tell application "System Events" to display dialog "toggleErrorsEmailList error " & errmsg
end try
end toggleErrorsEmailList:
And what, you ask, was the beginning of it all?
And it is this......
Existence that multiplied itself
For sheer delight of being
And plunged with numberless trillions of forms
So that it might
find
itself
innumerably
Sri Aurobindo