Iビームカーソルでテキストを選択し、今9字取りの文字列を7字取りに変更といったことができるスクリプト
tell application "Adobe InDesign CS2_J" tell document 1 --最小3文字 set ANS to display dialog "何字取りを何字取りにしますか?¬ " default answer "9/7" buttons {"OK"} set myStr to text returned of ANS set motoJIDORI to 9 set newJidori to 7 set motoJIDORI to my nthFields(myStr, "/", 1) set newJidori to my nthFields(myStr, "/", 2) set selectedItems to selection if selectedItems is {} then return end if set selItem to item 1 of selectedItems tell selItem set jidori of every character whose jidori is motoJIDORI to newJidori end tell end tell end tell on nthFields(myStr, sep, num) set OriginalDelimiters to AppleScript's text item delimiters set AppleScript's text item delimiters to {sep} set myStr to text items of myStr set AppleScript's text item delimiters to OriginalDelimiters return item num of myStr end nthFields
コメントする