2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

テキストフレームの配列をX座標でソートしてみる

Posted at
//オブジェクトのソートサンプル
//①複数のテキストフレームを選択
//②①のテキストフレームを配列に入れる
//③配列内でのテキストフレームの順番をX座標順にソートする

//ソート用の関数X座標昇順に並べる
function mySort(a,b) {
	return(a.visibleBounds[1]-b.visibleBounds[1]);
}

//ドキュメント
myDoc = app.activeDocument;
var myObj = new Array();
myObj = myDoc.selection;
myObj.sort(mySort);
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?