In the handler section below, I get two errors, the last error if I comment out the first offending line.
The errors are.
Why doesn’t this darn script like me? I can’t work out what’s wrong. Any advice please?
try
set p to 1
set myFont to current application's NSFont's fontWithName:"Cochin" |size|:14
set p to 2
set AppleColors to current application's NSColorList's colorListNamed:"Apple"
set p to 3
set someColor to AppleColors's colorWithKey:"Orange"
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 5
set theTextToSet to mainMessagesView's textStorage()
set p to 6
set theRange to {textOffSet, xx}
set p to 7
mainMessagesView's setAllowsEditingTextAttributes:(true)
set p to 8
theTextToSet's addTemporaryAttributes:attrsDict forCharacterRange:theRange
on error errmsg
tell current application to display dialog "Setting color " & errmsg & " p = " & p
end try