首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >调整放置图像的InDesign Applescript

问调整放置图像的InDesign Applescript
EN

Stack Overflow用户
提问于 2015-02-23 13:22:06
回答 2查看 1.7K关注 0票数 0

请解释如何使applescript理解我想要选择活动页面上的所有图像(在我的例子中,这将是一个),以调整图像的大小并使框架适合内容。

代码语言:javascript
复制
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

这显然行不通..。

谢谢!

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-02-23 15:23:36

只是想给你一些想法:

代码语言:javascript
复制
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和一个框架。您需要在几何边界上设置您的值。

代码语言:javascript
复制
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
票数 1
EN

Stack Overflow用户

发布于 2015-02-23 19:36:40

这是最后的答案-感谢nicolai.kant!

代码语言:javascript
复制
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 tell
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28674788

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档