• 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: Calculating paragraph numbers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calculating paragraph numbers


  • Subject: Re: Calculating paragraph numbers
  • From: Nebagakid <email@hidden>
  • Date: Thu, 29 Jan 2004 08:09:05 -0500

Well, if you implemented some AppleScript, you could do something like this, but I do not think this is what you want:

tell app "myAPP"
set thisVariable to the count of paragraphs in the content of text field "thisTextField"
end app

Now you have an applescript variable which you can use to set the content of other text fields, views, or other things!

-Danny Cohen
On Jan 29, 2004, at 2:54 AM, email@hidden wrote:

Hi All,

I'm trying to figure out how I can calculate the paragraph number of the
current selection in a text view. I've studied the code on
http://developer.apple.com/documentation/Cocoa/Conceptual/TextLayout/ Tasks/C
ountLines.html, but it suggests that I iterate over the entire text to count
the lines. Is there some way to get this information directly? Otherwise,
I can see this getting slower and slower as the length of text grows.

Cheers
-Mark
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Calculating paragraph numbers
      • From: Peter Jaros <email@hidden>
  • Prev by Date: dealloc, release, NSWindowController
  • Next by Date: Re: Notification redundancy
  • Previous by thread: Re: Calculating paragraph numbers
  • Next by thread: Re: Calculating paragraph numbers
  • Index(es):
    • Date
    • Thread