• 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
Here's another stumping, please
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Here's another stumping, please


  • Subject: Here's another stumping, please
  • From: Brian Christmas <email@hidden>
  • Date: Mon, 28 Jul 2014 20:20:42 +1000

I don't for the life of me understand how to set this up. replaceCharactersInRange_withString_   works,  but if I try to use the replaceOccurrencesOfString_withString_options_range_     then I get an error. I've set the options to 1 to make sure the text doesn't have to match exactly, and I'm using the same format for range as replaceCharactersInRange_withString_    and the  text is set up the same. So, what's wrong with it, please?

Regards

Santa



set textStorage to textView's textStorage()
-- append new text
set newTextLength to textStorage's |length|() as integer
set oldText to "Count of recognizable Job attachments is : 0"
set newText to "Count of recognizable Job attachments is : " & actualPrintableJobsAttachmentcounter
set p to 1
tell textStorage to replaceOccurrencesOfString_withString_options_range_(oldText, newText, 1 as integer, {newTextLength - 400, newTextLength - 100})
set p to 2
set newTextLength to textStorage's |length|() as integer
tell textStorage to replaceCharactersInRange_withString_({newTextLength - 196, 66}, theText)


 _______________________________________________
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: Here's another stumping, please
      • From: Shane Stanley <email@hidden>
    • Re: Here's another stumping, please
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Another hassle
  • Next by Date: Re: Another hassle
  • Previous by thread: Re: Another hassle
  • Next by thread: Re: Here's another stumping, please
  • Index(es):
    • Date
    • Thread