• 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
Scripting Pages 11.1 on Catalina
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Scripting Pages 11.1 on Catalina


  • Subject: Scripting Pages 11.1 on Catalina
  • From: Christian Boyce via AppleScript-Users <email@hidden>
  • Date: Mon, 26 Jul 2021 17:10:57 -0700

I am trying to automate the scaling of a PDF that has been inserted into a
Pages document.

For simplicity I am working with an otherwise blank Pages document, with a
single image on it.

I have two problems.

1. If I run this script I get an error when attempting to get the properties of
the image firstImage:

tell application "Pages"
        tell page 1 of document 1
                set theImages to every image
                set firstImage to item 1 of theImages
                set theProps to properties of firstImage
        end tell
end tell

I don't really need to get the properties but I'm interested in them because I
want to see what they are now, before I make changes.

2. By default, the image seems to come in with Constrain Proportions turned on.
This doesn't happen with "shapes" such as the lines, boxes, and ovals that can
be inserted from the Insert menu. Any image I choose using "Insert/Choose…" in
Pages comes in with Constrain Proportions checked. I would like to uncheck that
box as I want to scale the image to exact dimensions, and it won't be
proportional (that's the way I want it). But I can't figure out how to turn off
the Constrain Proportions option. I could resort to GUI scripting but I'd
rather not.

(It turns out that even though I can't GET the properties of an inserted image
I can SET at least some of them, including height and width. But I can't do
that non-proportionally.)

Bonus third question: is there a way to set the cropping (or "masking" as Pages
calls it) via AppleScript? That would be ideal. I don't see it in the
dictionary but maybe…?
 _______________________________________________
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: Re: Print to PDF in Safari
  • Previous by thread: Re: Print to PDF in Safari
  • Index(es):
    • Date
    • Thread