Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Offset placed image within rectangle

New Here ,
Oct 22, 2008 Oct 22, 2008
I need the code that allows me to offset image within a rectangle. Hopefully within properties as I place image on imageFrame. I've googled for quite a while. All help appreciated.

set filePath to alias "Mac_3a:Users:kevin:Documents:DustBin:20080807:theImage.pdf"

tell application "Adobe InDesign CS3" to tell document 1
set imageFrame to make rectangle at page 1 with properties {geometric bounds:{0, 0, 5, 7}}
place filePath on imageFrame with properties {absolute horizontal scale:30, absolute vertical scale:30}
end tell
TOPICS
Scripting
601
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Oct 22, 2008 Oct 22, 2008
You need to set the geometric bounds of the graphic after you've placed it.<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 23, 2008 Oct 23, 2008
This code works, if slightly inaccurate in placement. Please notice the commented code showing an error when attempting to retrieve geometric bounds of the image within the rectangle. Any thoughts on that error?

set frameBounds to {0.0, 0.0, 11.0, 8.5}
set linkPath to alias "Mac_3a:Users:kevin:Pictures:Faux Fur.jpg"
set linkOffset to {-1, -3, 0, 0}

tell application "Adobe InDesign CS3"
tell document 1
tell page 1
set imageFrame to make rectangle with properties {geometric bounds:frameBounds}
set framedImage to place linkPath on imageFrame with properties {absolute horizontal scale:100, absolute vertical scale:100, geometric bounds:linkOffset}
-- tell framedImage to get geometric bounds -- this code errors
end tell
end tell
end tell
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 23, 2008 Oct 23, 2008
LATEST
Hi Kevin,

You can use the move method. Something like this:

--Measurement units are points.

set frameBounds to {0, 0, 712, 692}
set linkPath to alias "hazuki:test.jpg"

tell application "Adobe InDesign CS3"
tell document 1
tell page 1
set imageFrame to make rectangle with properties {geometric bounds:frameBounds}
set framedImage to place linkPath on imageFrame with properties {absolute horizontal scale:100, absolute vertical scale:100}
--The place method returns an array.
tell item 1 of framedImage
move by {-216, -72}
end tell
end tell
end tell
end tell

Thanks,

Ole
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines