Last active
January 13, 2019 05:02
-
-
Save UskeS/cb047e0c00dedc41857b25df4bf6adbf to your computer and use it in GitHub Desktop.
[InDesign][ExtendScript] 選択したオブジェクトを以降のスプレッド全てに同位置に複製する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function (){ | |
//状態チェック | |
if (app.documents.length === 0) { | |
alert("ドキュメントを開いてから実行してください"); | |
return; | |
} | |
if (app.selection.length === 0) { | |
alert("オブジェクトを選択してから実行してください"); | |
return; | |
} | |
//変数定義 | |
var doc = app.activeDocument; | |
var win = app.activeWindow; | |
var spr = doc.spreads; | |
var sprInd = win.activeSpread.index; | |
var act = app.menuActions.itemByName("元の位置にペースト"); | |
app.copy(); | |
//アクティブなスプレッド以降の全スプレッドで同位置に複製 | |
for (var i=sprInd+1; i<spr.length; i++) { | |
win.activeSpread = doc.spreads[i]; | |
if (act.isValid && act.enabled) { | |
act.invoke(); | |
} | |
} | |
alert("終了しました"); | |
}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment