一行コピペ

私は流し込みの時にエディターとInDesignを行ったり来たりしないで、
テキストファイルをドキュメントにドロップしてコピーペーストしていくことがあります。

行の選択取得→行の選択流し込みをショートカット1発でできるので、
自動化されていない細かいコピーペーストに重宝します。

スクリプトエディタで開く

property a4 : “”
tell document 1 of application “Adobe InDesign CS2_J”
if a4 = “” then
set a0 to object reference of paragraphs of selection
set a1 to do shell script “echo \”” & (contents of paragraphs of selection as Unicode text) & “\” | grep ‘.*'”
set the clipboard to a1
set a4 to a1
delete a0
else
set a0 to object reference of paragraphs of selection
set a2 to length of (do shell script “echo \”” & (contents of paragraphs of selection as Unicode text) & “\” | grep ‘.*'”)
ignoring application responses
select character a2 of paragraphs of selection existing selection add to
select character 1 of paragraphs of selection existing selection add to
try
set contents of selection to “a”
set contents of selection to a4
end try
end ignoring
select character 1 of paragraphs of selection existing selection add to
set a4 to “”
end if
end tell