Thanks Shane
That brings me back to something I'de already tried, and I get a 'concrete' in the log.
itemForAttributes
2014-09-25 21:32:17.723 ApplescriptObjC Wizard[42279:303] N{ NSColor = "NSCalibratedRGBColorSpace 1 0.29803 0.98823 1"; NSFont = "\"Cochin 16.00 pt. P [] (0x104370250) fobj=0x10016d340, spc=4.00\""; }
What's frustrating is that the information I need is in the log (the NSColor info).
What I'm trying to do is read the NSColor value of an Attributed text character, and compare it with a list of stored NSColors from the first character of previously drawn paragraphs.
If a match is found, that paragraph will not be redrawn, and then, I'd like to scroll the the start of the matching paragraph, copy the already drawn paragraph, change the colour of each character to orange, (whilst preserving the font characteristics), then alternatively flash the orange coloured paragraph and previous coloured paragraph text several times.
Regards
Santa
On 25/09/2014, at 9:18 PM, Shane Stanley < email@hidden> wrote: On 25 Sep 2014, at 8:17 pm, Brian Christmas < email@hidden> wrote: I think I'm correct in saying that to get a non-concrete Attributable text string, I need to use the method, so, I've tried, with no success.
No. In this context, concrete means nothing to you; it's just a subclass of attributed string. It's nothing to do with mutability, if that's what you're thinking.
set x to current application's NSAttributedString's alloc()'s initWithString:"blah" current application's NSLog("%@", x's |class|()) --> NSConcreteAttributedString x's isKindOfClass:(current application's NSAttributedString)
I've tried (amongst others) the five permutations below, each with an 'unrecognised selector' error trap error. Without the error trap, the log reports the same.
I found this CFAttributedStringCreateMutableCopy(NULL, 0, attr_text));
on the net, but it does not seem to relate to the ASObjC method that's required.
CFAttributedStringCreateMutableCopy() is a C function, not an Objective-C method, and it belongs to CoreFoundation.framework -- thus the CF. As such, you basically can't use it in ASObjC. See my book, page 2.
Two questions, please.
1. Am I on the right track to create a non-concrete Attributable string, and if so…
You're on the wrong track worrying about concrete anything.
2. What's the correct terminology please?
It's not obvious to me what you're actually after. If you want a mutable copy, just use mutableCopy().
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
|