オーバーフローしたテキストを長体で押し込む

[JavaScript]


var frame = app.activeDocument.selection[0];
try{
while(frame.overflows){
frame.parentStory.horizontalScale = frame.parentStory.horizontalScale - 1;
}
}catch(e){
frame.parentStory.horizontalScale = 100;
alert("長体かけまくりましたが範囲を超えちゃいました!テヘ(^。^)");
}

[VBScript]


'VBSのエラー処理なんて忘れましたw
Set app = CreateObject("InDesign.Application")
Set frame = app.activeDocument.selection(1)
While frame.overflows
frame.parentStory.horizontalScale = frame.parentStory.horizontalScale - 1
Wend

※平体の場合
frame.parentStory.verticalScale = frame.parentStory.verticalScale - 1;


※参考
二分探索っぽくオーバーフロー処理をしてみたサンプル