下記は段落(paragraph)の文字列と見せかけの行(line)の文字列を比べ、同じになるまで3%きざみで長体をかけます。
tell application "Adobe InDesign CS2_J"
tell document 1
set selectedItems to selection
if selectedItems is {} then
return
end if
set selItem to item 1 of selectedItems
set myPer to 97
--まずスタートパーセントを97にする。
repeat
--繰り返し
set pStr to every paragraph of selItem as string
--段落のテキストを取り出す
set Lstr to line 1 of selItem as string
--ライン(みかけの行)のテキストを取り出す
if pStr is not Lstr then--もし段落と見かけの行が違うなら
--変倍をかける
set horizontal scale of paragraph 1 of selItem to myPer
--パーセントから3を引いておく
set myPer to myPer - 3
else--段落と見かけの行が同じなら
exit repeat--繰り返しを抜ける
end if
end repeat
end tell
end tell
コメントする