• 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: clipping path bounds
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: clipping path bounds


  • Subject: Re: clipping path bounds
  • From: Stan Cleveland <email@hidden>
  • Date: Wed, 28 Mar 2012 17:58:52 -0700

On Mar 26, 2012, at 3:08 AM, email@hidden wrote:

Does anyone know the right syntax to get the bounds of a clipping path of a placed image in Indesign?

---snip
set {ImageY1, ImageX1, ImageY2, ImageX2} to geometric bounds of TheImage
set {FrameY1, FrameX1, FrameY2, FrameX2} to geometric bounds of TheFrame
---snip
I can get the bounds of t he frame and image, but I need the clipping path bounds if present.

Hi j,

The method I'll suggest is a workaround and somewhat intrusive, because it requires modifying the InDesign layout. Specifically, the rectangle that contains the image will be resized. However, this change won't be evident IF you are in the habit of placing images with clipping paths into otherwise empty (i.e. - unfilled and unstroked) rectangles. Alternatively, you could restore the original bounds of the rectangle after getting the information you need. Take note of the version-specific syntax.

tell application "Adobe InDesign CS5"
set usingInDesignCS5orNewer to version > "7"
tell rectangle 1 of page "1" of document 1

-- use one of the following two commands to activate the desired image clipping path within InDesign
-- however, neither command is needed if a clipping path is already assigned within the image file
if usingInDesignCS5orNewer then
set properties of clipping path of item 1 of all graphics to ¬
{clipping type:photoshop path, applied path name:"Path 1"}
else -- InDesign CS4 or older (not sure how far back this works)
set properties of contour option of item 1 of all graphics to ¬
{contour type:photoshop path, contour path name:"Path 1"}
end if


-- this will resize the parent rectangle to the bounds of the image clipping path
fit given frame to content


-- get the bounds of the rectangle, which now match the bounds of the image clipping path
set {t, l, b, r} to geometric bounds -- top, left, bottom, right
set {w, h} to {r - l, b - t} -- width and height, if desired


end tell
end tell

Hope that all makes sense.

Stan C.

 _______________________________________________
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

References: 
 >clipping path bounds (From: email@hidden)

  • Prev by Date: Re: removing parenthesis
  • Next by Date: RE: Re: clipping path bounds
  • Previous by thread: clipping path bounds
  • Next by thread: RE: clipping path bounds
  • Index(es):
    • Date
    • Thread