请解释如何使applescript理解我想要选择活动页面上的所有图像(在我的例子中,这将是一个),以调整图像的大小并使框架适合内容。
tell application "Adobe InDesign CS6"
set myPagecount to count pages of active document
repeat with i from 1 to myPagecount
set thisImage to select every graphic frame of page i
tell content of thisImage
set height to "11in"
set width to "8.5in"
fit given frame to content
end tell
end repeat
end tell这显然行不通..。
谢谢!
发布于 2015-02-23 15:23:36
只是想给你一些想法:
tell application "Adobe InDesign CS5.5"
activate
set myPagecount to count pages of active document
tell active document
set myPage to page 1
tell page myPage
tell item 1 of all graphics of myPage
set geometric bounds of it to {10, 10, 0, 0}
end tell
end tell
end tell
end tell只需引用您的页面和循环通过集合的所有图形。您需要更改几何边界的值,使用引号表示英寸("8.5in")。
=================================
编辑:
上面的代码实际上调整了框架内的图形/pdf的大小。我增加了两个版本-一个为pdf和一个框架。您需要在几何边界上设置您的值。
tell application "Adobe InDesign CS6"
activate
set myPagecount to count pages of active document
tell active document
set myPage to page 1
tell page myPage
tell item 1 of all graphics of myPage
set geometric bounds of it to {100, 100, 0, 0}
end tell
tell text frame 1 of myPage
set geometric bounds of it to {100, 100, 0, 0}
end tell
end tell
end tell
end tell发布于 2015-02-23 19:36:40
这是最后的答案-感谢nicolai.kant!
tell application "Adobe InDesign CS6"
set myPagecount to count pages of active document
tell active document
repeat with i from 1 to myPagecount
set myPage to page i
tell page myPage
tell item 1 of all graphics of myPage
set geometric bounds of it to {"8.5in", "11in", 0, 0}
fit given frame to content
end tell
end tell
end repeat
end tell
end tellhttps://stackoverflow.com/questions/28674788
复制相似问题