-
-
Save AJABON/108ffe920fd8de4ef9a81fc5244caee5 to your computer and use it in GitHub Desktop.
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
//InDesign_空のオブジェクトを削除 | |
var doc = app.activeDocument; //処理対象は最前面ドキュメントの中ぜんぶ | |
var ary = doc.allPageItems; | |
// ↑allPageItemsは各グループ内オブジェクトを個別取得でけます。それを配列に | |
var kesuAry = []; //削除するオブジェクトを集めておくための配列 | |
//配列aryの要素をループ処理開始 | |
for (var i = 0; i < ary.length; i++) { | |
// ↓i番目要素の、塗りカラー、線カラー両方とも適用スウォッチ名が「なし」なら、という条件文 | |
if (ary[i].fillColor.name == "None" && ary[i].strokeColor.name == "None"){ | |
kesuAry.push (ary[i]); //削除用配列に追加 | |
} | |
} | |
while (kesuAry.length) { //削除用配列がカラッポになるまで | |
kesuAry.shift().remove(); //配列の先頭を抜き出した物を削除 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment