One more time, I'm fighting against Pages.
If I apply this script
tell application "Pages" to tell document 1 set nbTextBoxes to count of text box repeat with i from 1 to nbTextBoxes set bProps to (get properties of text box i) set maybe to horizontal position of bProps log maybe end repeat end tell
to a Pages WP document embedding a text box with an yellow background, I get this log report:
tell application "Pages" count every text box of document 1 1 get properties of text box 1 of document 1 {stroke type:none, image fill type:missing value, horizontal position:46.0, class:text box, stroke width:missing value, text fit:rectangle, width:200.0, stroke color:missing value, extra space:12.0, wrap:center, image data:missing value, placement:moving, shadow angle:missing value, vertical position:57.0, fill type:color, height:100.0, object text:"text box 2 ", id:5107277, containing page:page 1 of document id 5441209, shadow blur:missing value, shadow opacity:missing value, shadow color:missing value, color angle:missing value, opacity:100.0, locked:0, containing layer:missing value, name:missing value, shadow:missing value, rotation:0.0, shadow offset:missing value, start color:missing value, single color:{65535, 65535, 13107}, end color:missing value} (*46.0*) end tell
If I replace set maybe to horizontal position of bProps by set maybe to single color of bProps
I get :
tell application "Pages" count every text box of document 1 1 get properties of text box 1 of document 1 … "Impossible d’obtenir single color of {stroke type:none, image fill type:missing value, horizontal position:46.0, class:text box, stroke width:missing value, text fit:rectangle, width:200.0, stroke color:missing value, extra space:12.0, wrap:center, image data:missing value, placement:moving, shadow angle:missing value, vertical position:57.0, fill type:color, height:100.0, object text:\"text box 2 \", id:5107277, containing page:page 1 of document id 5441209 of application \"Pages\", shadow blur:missing value, shadow opacity:missing value, shadow color:missing value, color angle:missing value, opacity:100.0, locked:0, containing layer:missing value, name:missing value, shadow:missing value, rotation:0.0, shadow offset:missing value, start color:missing value, single color:{65535, 65535, 13107}, end color:missing value}."
to be continued…
|