• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AppleScript, Pages and Text boxes (part 2)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript, Pages and Text boxes (part 2)


  • Subject: Re: AppleScript, Pages and Text boxes (part 2)
  • From: Yvan KOENIG <email@hidden>
  • Date: Sat, 20 Mar 2010 18:48:49 +0100


Le 20 mars 2010 à 12:50, Axel Luttgens a écrit :

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 fill type of graphics whose class is text box and single color is theColor to none

end if

end tell

end tell



Thanks.
It's a really clever script but it was easy to use it to set the color to miossing value.

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



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: AppleScript, Pages and Text boxes (part 2)
      • From: Axel Luttgens <email@hidden>
References: 
 >AppleScript, Pages and Text boxes (part 1) (From: Yvan KOENIG <email@hidden>)
 >Re: AppleScript, Pages and Text boxes (part 1) (From: Axel Luttgens <email@hidden>)
 >Re: AppleScript, Pages and Text boxes (part 1) (From: "email@hidden" <email@hidden>)
 >Re: AppleScript, Pages and Text boxes (part 1) (From: Yvan KOENIG <email@hidden>)
 >Re: AppleScript, Pages and Text boxes (part 1) (From: Yvan KOENIG <email@hidden>)
 >Re: AppleScript, Pages and Text boxes (part 2) (From: Yvan KOENIG <email@hidden>)
 >Re: AppleScript, Pages and Text boxes (part 2) (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: AppleScript, Pages and Text boxes (part 2)
  • Next by Date: Re: Osascripting
  • Previous by thread: Re: AppleScript, Pages and Text boxes (part 2)
  • Next by thread: Re: AppleScript, Pages and Text boxes (part 2)
  • Index(es):
    • Date
    • Thread