LoginSignup
1
1

More than 5 years have passed since last update.

続・iterm2にもteratermみたいな複数行ペーストを確認する機能が欲しくて

Last updated at Posted at 2015-11-17

may-i-pasteがとても良かったのだが、自分の環境ではうまく動かなくなってしまった。
http://qiita.com/kaorukit/items/09ef1551beacff866027
ので、作り変えてみた。
色々試してたらほぼ別物になってしまった。

System Eventsを呼び出してcommand + vを叩く挙動になっているので他のショートカットに設定する必要があるのがイマイチなんだが、これしか自分の環境で動かなかったので。。。

Paste.scpt
set strClip to get the clipboard
set asciiCr to ASCII character 13
set findCr to offset of asciiCr in strClip

if findCr = 0 then
    tell application "System Events" to keystroke "v" using {command down}
else if findCr > 0 then
    set EditTxt to the text returned of (display dialog "may i paste?" default answer strClip)
    set the clipboard to EditTxt
    tell application "System Events" to keystroke "v" using {command down}
end

オリジナルがどうだったか覚えてないが、確認窓のテキストを編集するとペーストに反映されるようにしてある。

1
1
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
1
1