I use the below in part of my code to place an image into an Indesign CS5.5
document, cropping to the bleed on four sides, what I am trying to do now is crop
to only three sides of my placed image, top, left and right the bottom needs to crop
to the trim, of the image, can this be done?, or would it be easier to have the bottom
of the bleed area moved up once the image is placed?
tell application "Adobe InDesign CS5.5"
activate
set PDF crop of PDF place preferences to crop bleed
set transparent background of PDF place preferences to true
tell document 1
place PicList as alias on page 1
end tell
end tell
Your question is a bit confusing ” are you saying you’re happy to leave the top, left and right as they are and just move the bottom edge of the frame?
If you’re just moving the bottom edge up by a set amount you could do it like this :
tell document 1
set thisPic to place PicList as alias on page 1
set geoBounds to geometric bounds of parent of thisPic
set item 3 of geoBounds to ((item 3 of geoBounds) - 5)
set geometric bounds of parent of thisPic to geoBounds
end tell
the code throws an error as per below, and i’m not quite sure how to remedy it.
error “Can’t get parent of {PDF id 287 of rectangle id 292 of spread id 184 of document id 1 of application "Adobe InDesign CS5.5"}.” number -1728 from parent of {«class PDF » id 287 of «class crec» id 292 of «class sprd» id 184 of document id 1}
tell application "Adobe InDesign CS5.5"
activate
set PicList to "PATH TO PDF"
set PDF crop of PDF place preferences to crop bleed
set transparent background of PDF place preferences to true
tell document 1
set thisPic to place PicList as alias on page 1
set geoBounds to geometric bounds of parent of thisPic
set item 3 of geoBounds to ((item 3 of geoBounds) - 5)
set geometric bounds of parent of thisPic to geoBounds
end tell
end tell
i changed the code slightly and this is doing the trick now.
tell document 1
set thisPic to place PicList as alias on page 1
set geoBounds to geometric bounds of item 1 of thisPic
set item 3 of geoBounds to ((item 3 of geoBounds) + 5)
set geometric bounds of item 1 of thisPic to geoBounds
end tell
using item 1 seems to stretch the image, so this is not right
i cant seem to get the below to work either
“item 1 of parent” or parent as string.
set geoBounds to geometric bounds of item 1 of parent of thisPic --as string
set item 3 of geoBounds to ((item 3 of geoBounds) - 5)
set geometric bounds of item 1 of parent of thisPic to geoBounds --as string
tell document 1
set thisPic to place PicList as alias on page 1
set myGraphic to item 1 of thisPic
set myFrame to parent of myGraphic
set myBounds to geometric bounds of myFrame
set item 3 of myBounds to ((item 3 of myBounds) - 4.2)
set geometric bounds of myFrame to myBounds
end tell