G'day Shane
Thanks for your advice.
I'ver altered the script as you suggested, and have actually got back to where I first started, which does not work.
I've spent 7 blasted hours trying different permutations, thinking my original method must have been wrong, with a total waste of time.
I'm trying to match the colour of the first character of a paragraph with a stored colour, and if a match is found, copy the paragraph as Attributed text from a set of Attributed text paragraphs, alter the font colour of the whole paragraph to orange (and keep the original font styles and sizes), and flash alternative orange/original text in the scroll field.
Why won't the last two lines work, please?
Regards
Santa
display dialog theStartOfPlainTextParagraph & " start" & return & theEndOfPlainTextParagraph & " end" & return & mainMessagesAttributedText's |length| & " attributed length" as text # <=== 438,537,537, so we've got an attributed string
set theVariedAttributedText to mainMessagesAttributedText's attributedSubstringFromRange_({theStartOfPlainTextParagraph as integer, theEndOfPlainTextParagraph as integer})
set {itemAttributes, {rangeStart, rangeEnd}} to mainMessagesAttributedText's attributesAtIndex_effectiveRange_(theStartOfPlainTextParagraph as integer, {theStartOfPlainTextParagraph as integer, theStartOfPlainTextParagraph as integer})
On 24/09/2014, at 9:11 PM, Shane Stanley < email@hidden> wrote: On 24 Sep 2014, at 7:49 pm, Brian Christmas < email@hidden> wrote: set theVariedAttributedText to initWithAttributedString_(mainMessagesAttributedText's attributedSubstringFromRange_(theStartOfPlainTextParagraph as integer, theEndOfPlainTextParagraph as integer))
Where to start. From the front, an init- method is always an instance method, and it always follows alloc(). You seem to be trying to call it on nothing at all. What do you think that might do?
But the whole bit before the first parenthesis is unnecessary anyway -- if you don't have an attributed string by then, that's not going to magically conjure one up.
At the other end, you're trying to call a method with one underscore, and therefore requiring one parameter, but you're passing two. That's your real problem; the rest is just a case of "keep digging".
The second is I'm trying to retrieve the red, green, blue, alpha vales of an Attributed text character, without success.
set {red1, green1, blue1, alpha1} to itemForAttributes's myFontColor's getRed_green_blue_alpha_(red, green, blue, alpha)
The method says it returns void, and that's what you're getting.
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
|