• 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: Can this be done, change hilite color?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can this be done, change hilite color?


  • Subject: Re: Can this be done, change hilite color?
  • From: Brian Christmas <email@hidden>
  • Date: Tue, 05 Apr 2016 10:15:17 +1000

G’day once more, with another problem on this thread.

In the handler section below, I get two errors, the last error if I comment out the first offending line.

The errors are.

1. Setting color -[NSConcreteTextStorage setAllowsEditingTextAttributes:]: unrecognized selector sent to instance 0x7fc815df0fe0 p = 7

2. Setting color -[NSConcreteTextStorage addTemporaryAttributes:forCharacterRange:]: unrecognized selector sent to instance 0x7fe0be032700 p = 8

 mainMessagesView is bound to the Text View of the Scroll field

Why doesn’t this darn script like me? I can’t work out what’s wrong. Any advice please?

Regards

Santa

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


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Can this be done, change hilite color?
      • From: Shane Stanley <email@hidden>
References: 
 >Re: Can this be done, change hilite color? (From: Shane Stanley <email@hidden>)
 >Re: Can this be done, change hilite color? (From: Brian Christmas <email@hidden>)
 >Re: Can this be done, change hilite color? (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Can this be done, change hilite color?
  • Next by Date: Re: Can this be done, change hilite color?
  • Previous by thread: Re: Can this be done, change hilite color?
  • Next by thread: Re: Can this be done, change hilite color?
  • Index(es):
    • Date
    • Thread