スクスニップ

AppleScriptの断片をここに書く

InDesign テキストフレームのオーバーフローを取得する AppleScript

2-2 01 オーバーフローしているページをダイアログに表示

組版時間を半減する! InDesign自動処理実例集

組版時間を半減する! InDesign自動処理実例集

f:id:mikomaya:20141110170143p:plain

-- まずは部品作り
--ページ数の取得
tell application "Adobe InDesign CS6"
    number of page of active document
end tell

-- 指定ページに配置されたテキストフレームの数を取得
set myPage to 3
tell application "Adobe InDesign CS6"
    number of every text frame of page myPage of active document
end tell

-- テキストフレームがオーバーフローしているか?
set myPage to 2
set fIdx to 1
tell application "Adobe InDesign CS6"
    overflows of text frame fIdx of page myPage of active document
end tell

部品が揃ったので、まとめ

tell application "Adobe InDesign CS6"
    tell active document
        set pMax to number of pages
        repeat with pidx from 1 to pMax
            tell page pidx
                set fMax to number of every text frame
                repeat with fIdx from 1 to fMax
                    if overflows of text frame fIdx is true then
                        display dialog "" & pidx & "ページにオーバーフローしたテキストフレームあり[" & fIdx & "]"
                    end if
                end repeat
            end tell
        end repeat
    end tell
end tell

--実行結果

f:id:mikomaya:20141110170151p:plain

f:id:mikomaya:20141110170155p:plain