• 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: Weird behavior of text in Pages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weird behavior of text in Pages


  • Subject: Re: Weird behavior of text in Pages
  • From: "koenig.yvan" <email@hidden>
  • Date: Wed, 30 Jul 2014 10:40:07 +0200


Le 30/07/2014 à 00:27, Stockly, Ed <email@hidden> a écrit :

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




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: Weird behavior of text in Pages (From: "Stockly, Ed" <email@hidden>)

  • Prev by Date: Re: Read a text file
  • Next by Date: Re: Weird behavior of text in Pages
  • Previous by thread: Re: Weird behavior of text in Pages
  • Next by thread: Re: Weird behavior of text in Pages
  • Index(es):
    • Date
    • Thread