• 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 box (part 2)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AppleScript, Pages and text box (part 2)


  • Subject: AppleScript, Pages and text box (part 2)
  • From: Yvan KOENIG <email@hidden>
  • Date: Thu, 18 Mar 2010 18:28:10 +0100

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

 _______________________________________________
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

  • Prev by Date: AppleScript, Pages and Text boxes (part 1)
  • Next by Date: Re: AppleScript, Pages and Text boxes (part 1)
  • Previous by thread: Re: AppleScript, Pages and Text boxes (part 1)
  • Next by thread: Is that possible to use applescript to detect GUI truncation issue?
  • Index(es):
    • Date
    • Thread