Has this been resolved?
I ask because I've noticed something similar (but different) in BBEdit. If it define the TIDs inside {} and then coerce a list to text, it acts as if there TIDs are empty. In your handler you're not using the {} and I'm wondering if you would get a different result if you did.
my tid(return)
on tid(x) set AppleScript's text item delimiters to {x} end tid
Here is a slightly modified version of what I sent to Deivy.It works flawlessly here : Pages 5.2 running under 10.9.4 — in French.
--<script for Page> tell application "Pages" to tell document 1 repeat with l from 1 to count every text item if exists object text of text item l then set tt to object text of text item l set td to my split_text(tt, {linefeed, return, character id 8233}) log td --return td -- disabled because it exits the loop end if end repeat if document body then set tt to body text set td to my split_text(tt, {linefeed, return, character id 8233}) log td --return td end if end tell
on split_text(tt, x) set AppleScript's text item delimiters to x return text items of tt end split_text
--<script for Page>--
I guess that the question was not really about splitting the text into paragraphs because using text delimiters isn’t the good way to do that. Pages may embed at least three characters to separate paragraphs : return linefeed the Unicode character $2029 (8233) It's why I use a list of three characters as delimiter.
Yvan KOENIG (VALLAURIS, France) mercredi 30 juillet 2014 10:40:03
|