Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Pages.app delete a range of text with Applescript?

Hi,


I can't manage to delete from Applescript a part of my Pages document delimited by two placeholders.


I can get the two placeholders, but how can I construct the rich text object that represents everything between them?


tell application "Pages"

set myDoc to front document

tell myDoc


set startPlaceHolder to (the first placeholder text whose tag is "startTag")

set endPlaceHolder to (the first placeholder text whose tag is "endTag")


set startChar to character 1 of startPlaceHolder

set endChar to last character of endPlaceHolder


set toDelete to (startCharthruendChar)



end tell


end tell


Thanks for the help


JD

Posted on May 28, 2015 9:36 AM

Reply

There are no replies.

Pages.app delete a range of text with Applescript?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.