property theColor : {}
tell application "Pages"
tell front document
set {btn1, btn2, btn3} to {"Cancel", "Pick", "Remove"}
set maybe to button returned of (display dialog "What?" buttons {btn1, btn2, btn3})
if maybe is btn2 then
if class of selection is {text box} then
set theColor to single color of graphic id (id of (item 1 of (get selection)))
else
-- not a single text box (multiple selection, insertion point...)
end if
else
set single color of (graphics whose class is text box and single color is theColor) to missing value
end if
end tell
end tell
I tested it under 10.4.11.
Yvan KOENIG (VALLAURIS, France) samedi 20 mars 2010 18:48:38