As I am pig headed, I tried with :
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) try set maybe to horizontal position of bProps log maybe log (get (single color) of bProps) on error errmsg set maybe to item 2 of my decoupe(errmsg, "single color:") set maybe to item 1 of my decoupe(maybe, "}") & "}"
end try log maybe log (get horizontal position of text box i) set properties of text box i to {horizontal position:240.0} log (get horizontal position of text box i) if maybe is "{65535, 65535, 13107}" then set properties of text box i to {single color:missing value} end repeat end tell
--=====
on decoupe(t, d) local l set AppleScript's text item delimiters to d set l to text items of t set AppleScript's text item delimiters to "" return l end decoupe
--=====
using an awful scheme to grab the color descriptor
I get : tell application "Pages" count every text box of document 1 1 get properties of text box 1 of document 1 … (*46.0*) (*{65535, 65535, 13107}*) get horizontal position of text box 1 of document 1 46.0 (*46.0*) set properties of text box 1 of document 1 to {horizontal position:240.0} get horizontal position of text box 1 of document 1 240.0 (*240.0*) set properties of text box 1 of document 1 to {single color:missing value} end tell
So, I am able to get/set horizontal position. I am able to get (thru an awful code) the single color but I am unable to set this one.
What am'I doing wrongly ?
Yvan KOENIG (VALLAURIS, France) jeudi 18 mars 2010 18:28:05
|