KeePassのAutoTypeでDonutをURL依存に

KeePassもDonutも書き換えず、適当にホットキーを定義することで可能です。KeePassのAutoTypeホットキー実行の瞬間にウインドウタイトルをURLに変えてしまうだけです。以下をホットキーで実行すると、KeePassにホットキーが送られる際に、Donutのウインドウタイトルが

Donut - [TITLE]

から、

URL - [TITLE]

になります。
コンボボックスの文字列の取得のためにsetup/OldDllSupportUnicodeを有効にしないといけません。

以下がそのホットキーに設定するスクリプトです。

SendKeePassAutoTypeHotKey: `[
  Window.SendMessage(Window.FindWild('#32770' 'KeePass Password Safe - [*]') WM_HOTKEY 0x21 0)
]

hwnd: Window.GetForeground
Window.GetClass(hwnd).== 'WTL:DonutRAPT'.? [
  include('wnd_str')
  hUrl: find_wnd_str(User32.FindWindowEx(hwnd 0 'ReBarWindow32' 0) r/:Donut_AddressBar:ComboBox:Edit$/)
  hUrl.! ['URLのウインドウが無い'.throw]

  title: Window.GetText(hwnd)
  title.=~ r/- ([^\-]+)$/.dollars
  Window.SetText(hwnd Window.GetText(hUrl))
  SendKeePassAutoTypeHotKey
  Window.SetText(hwnd $1)
], [
  SendKeePassAutoTypeHotKey
]