13
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

iTerm2をアップデートしたら背景色を変えるscriptが動かなくなった時のメモ

Last updated at Posted at 2016-06-02

iTermでsshするときにssh-host-colorを利用させてもらって背景色を変更しているんですが、iTerm2を3.0.0にアップデートしたら

end of line があるべきところですが identifier が見つかりました

と出るようになってしまった。
AppleScriptの互換性がなくなったことが原因の模様。

ので、

  /usr/bin/osascript <<EOF
tell application "iTerm"
  tell the current terminal
    tell the current session
      set background color to {$(($R*65535/255)), $(($G*65535/255)), $(($B*65535/255))}
    end tell
  end tell
end tell
EOF

  /usr/bin/osascript <<EOF
  tell application "iTerm"
    tell current session of first window
      set background color to {$(($R*65535/255)), $(($G*65535/255)), $(($B*65535/255))}
    end tell
  end tell
EOF

と修正したら直りました。
ApppleScript詳しくないので、どなたかスマートな書き方ご存知でしたら教えてください。

13
12
1

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
13
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?