Re: Calculating paragraph numbers
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.