Skip to content

Instantly share code, notes, and snippets.

@UskeS
Last active January 13, 2019 05:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UskeS/cb047e0c00dedc41857b25df4bf6adbf to your computer and use it in GitHub Desktop.
Save UskeS/cb047e0c00dedc41857b25df4bf6adbf to your computer and use it in GitHub Desktop.
[InDesign][ExtendScript] 選択したオブジェクトを以降のスプレッド全てに同位置に複製する
!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