• 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: Pages & AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pages & AppleScript


  • Subject: Re: Pages & AppleScript
  • From: KOENIG Yvan <email@hidden>
  • Date: Sun, 15 Feb 2009 22:58:26 +0100


Le 15 févr. 2009 à 21:50:05, email@hidden a écrit :

Not sure exactly what the property moving means but this is what have found...

When the graphic placement property changes the index also changes, so Yvan's script's last "get placement..." command was looking at another graphic. The version below uses the id.

There seems to be only one "moving" graphic allowed on a page (or in a document?) at a time, so if you repeat through a list of items on the page changing from fixed to moving it seems to reset the previous graphic back to fixed, so only the last graphic remains changed.

HTH

ES

------
--This script was tested on a document based on the "Visual Report" template
--It sometimes errors on the first run


tell application "Pages" to tell document 1
set cg to get count of graphic
set liste to {}
if cg > 0 then
 repeat with i from 1 to cg
  set thisGraphicId to id of graphic i
  set thisGraphic to (graphic 1 whose id is thisGraphicId)
  set graphicPlacement to placement of thisGraphic

  if graphicPlacement is fixed then
   set the end of liste to thisGraphicId
  end if
 end repeat
 if liste is not {} then
  repeat with graphicId in liste
   set thisGraphic to (graphic 1 whose id is thisGraphicId)

   set placement of thisGraphic to moving
   delay 0.2
   set thisGraphic to (graphic 1 whose id is thisGraphicId)
   get placement of thisGraphic
  end repeat
 end if -- liste
end if -- cg …
end tell -- document of application
--[/SCRIPT]

Thanks always to the same Ed ;-)

The property is ruling the fact that the object in
inline (moving)
or
floating (fixed)

Yvan KOENIG (from FRANCE dimanche 15 février 2009 22:57:32)


_______________________________________________ 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: Pages & AppleScript
      • From: "email@hidden" <email@hidden>
References: 
 >Pages & AppleScript (From: KOENIG Yvan <email@hidden>)
 >Re: Pages & AppleScript (From: email@hidden)

  • Prev by Date: Re: InDesign question
  • Next by Date: Re: Pages & AppleScript
  • Previous by thread: Re: Pages & AppleScript
  • Next by thread: Re: Pages & AppleScript
  • Index(es):
    • Date
    • Thread