Wednesday, June 26, 2019

#1 2018-12-28 06:51:31 am

Registered: 2018-11-30
Posts: 1

scripttag in Pages


I know how to make a scripttag in pages.

But I am looking for the correct syntax to change the placeholder text into the information that I read from a numbers spreadsheet cell.

Filed under: pages, scripttag



#2 2019-01-01 05:48:25 am

Nigel Garvey
From:: Warwickshire, England
Registered: 2002-11-20
Posts: 4884

Re: scripttag in Pages

Hi. And a belated welcome to MacScripter!

I've not had cause to use Pages placeholder texts, but fooling around with them this morning, it seems they have to be identified by their tags and then be set themselves to the replacement text. Once a placeholder text has been set to new text, it ceases to exist as a placeholder text, so if the color, font, or size have to be changed too, these have to be done first. Some examples:


tell application "Pages"
   tell document 1
       set first placeholder text whose tag is "Urna Semper" to "Fred Bloggs"
       set every placeholder text whose tag contains "Trenz" to "Flooble"
       tell (a reference to (first placeholder text whose tag begins with "Lorem"))
           set its color to {65535, 0, 0}
           set its size to 24
           -- 'contents' in the following line belongs to the reference, not to the placeholder text. It means the placeholder text itself.
           set its contents to "Caesar adsum iam forte, Nero adorat."
       end tell
   end tell
end tell




Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)