スクスニップ

AppleScriptの断片をここに書く

InDesign 空のテキストフレームを調べる AppleScript

2-2 02 空のテキストフレームがあるか調べる

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

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

部品作製

-- テキストフレーム内のコンテンツを取得
set myPage to 2
set fIdx to 1
tell application "Adobe InDesign CS6"
    contents of text frame fIdx of page myPage of active document
end tell

-- オブジェクトを選択状態にする
set myPage to 3
set fIdx to 2
tell application "Adobe InDesign CS6"
    select text frame fIdx of page myPage of active document
end tell

f:id:mikomaya:20141110173225p:plain

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

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 contents of text frame fIdx is "" then
                        select text frame fIdx
                        display dialog "" & pidx & "ページに空のテキストフレームあり[" & fIdx & "]"
                    end if
                end repeat
            end tell
        end repeat
    end tell
end tell

実行結果

f:id:mikomaya:20141110173237p:plain

f:id:mikomaya:20141110173241p:plain