• 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
AppleScript, Pages and Text boxes (part 1)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AppleScript, Pages and Text boxes (part 1)


  • Subject: AppleScript, Pages and Text boxes (part 1)
  • From: Yvan KOENIG <email@hidden>
  • Date: Thu, 18 Mar 2010 18:26:49 +0100

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…




 _______________________________________________
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 1)
      • From: Axel Luttgens <email@hidden>
    • Re: AppleScript, Pages and Text boxes (part 1)
      • From: "Stockly, Ed" <email@hidden>
  • Prev by Date: Re: excel
  • Next by Date: AppleScript, Pages and text box (part 2)
  • Previous by thread: Re: excel
  • Next by thread: Re: AppleScript, Pages and Text boxes (part 1)
  • Index(es):
    • Date
    • Thread