• 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
Requesting help with 'range' conversion, please
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Requesting help with 'range' conversion, please


  • Subject: Requesting help with 'range' conversion, please
  • From: Brian Christmas <email@hidden>
  • Date: Tue, 02 Dec 2014 09:11:53 +1100

I’ve got rid of all my comply errors in my Mail Manager app, except for this one that suddenly cropped up  (I don’t think it showed earlier because I had an Error 1 major compile error). The error in a ‘range’ error, 

range:{(eachAttributedCharacterCounter - 1) as integer, 1 as integer} 

and I cannot work out from Explored 5 how to convert it from Mountain Lion to Yosemite.

Any guidance greatly appreciated.

Regards

Santa

if weFoundAMatchingColorFlag then
set eachAttributedCharacterCounter to 0
set theFlashingNSColor to my matchAColor("Flashing Gold")
set p to 41
set fontAccess to current application's NSFontAttributeName
#
# Now, set every character of the copied text to a single color.
#
set tempStringText to theSameColoredAttributedText's |string|() as text
repeat with eachAttributedCharacterCounter from 1 to (count of tempStringText) # as integer
set p to 42
#
# Grab the Attributed font of each individual character
#
if item (eachAttributedCharacterCounter as integer) of tempStringText is not "" as text then
set p to 43
#
# Note that the Attributed text is zero based, so we subtract 1
#
set myFont to (theSameColoredAttributedText's attribute:(current application's NSFontAttributeName) atIndex:((eachAttributedCharacterCounter - 1) as integer) effectiveRange:{(eachAttributedCharacterCounter - 1) as integer, 1})
set p to 44
#
# Set the actual single character of the copied text to a single color,
# whilst keeping the font characteristics the same.
#
set attrsDict to (current application's NSDictionary's dictionaryWithObjects:{myFont, theFlashingNSColor} forKeys:{current application's NSFontAttributeName, current application's NSForegroundColorAttributeName})
set p to 45
tell theSameColoredAttributedText to setAttributes:attrsDict range:{(eachAttributedCharacterCounter - 1) as integer, 1 as integer}
end if
end repeat
end if


 _______________________________________________
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: Requesting help with 'range' conversion, please
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: What does this compile error mean please?
  • Next by Date: Re: Requesting help with 'range' conversion, please
  • Previous by thread: Re: What does this compile error mean please?
  • Next by thread: Re: Requesting help with 'range' conversion, please
  • Index(es):
    • Date
    • Thread