Skip to content

This HTA application that helps a little when your fingers are cramping up from frequent copying and pasting.

Notifications You must be signed in to change notification settings

takoyaki-umaaaaaa/CopyPasteAssistance

Repository files navigation

コピペ補助 (Copy Paste Assistance)1

動作画面

機能

[Push to Copy]ボタン押下で textareaの文字列を clipboardに copyする。
まだまだ実装中。とりあえずCopyはできる。

作成理由

仕事でコピペを多くする機会があったから。Ctrl+CCtrl+Vを繰り返し続けると指が攣りそうになるので……

最も力を入れている箇所

機能は単純でいい。
とにかく見た目を派手にしたい。

Project repository

https://github.com/takoyaki-umaaaaaa/CopyPasteAssistance


内部処理の話

設定ファイルについて

設定項目(実装中)の保存先としてADS(代替データストリーム)を使用している。単体ファイルで完結させたかったから。自己書き換えとかできれば良かったが…… そのためHTAファイルを編集したり、サーバー経由でのCopyで設定情報が消える可能性が高い。まあいいか。

設定ファイルの形式

ADS Name Character code Format CR LF
SettingData UTF-16LE BOM or non-BOM JSON LF

設定項目等は下記参照。名前からだいたい判断。パラメータの種類コメント2参照。

{
"comment": "Item挿入位置。TOP/BOTTOM",
"startupAdditionalPosition": "BOTTOM",
"comment": "背景画像選択番号。1~3",
"startupBackgroundImage": 1,
"comment": "起動時に表示するItem数。制限なし。",
"startupItemCount": 4,
"comment": "起動時のWindow幅。単位はpixel。",
"startupWindowWidth": 470,
"comment":"起動時のWindow高さ。単位はpixel。",
"startupWindowHeight":830,
"comment":"(未実装)アニメーション表示。true/false",
"displayAnimation": "true",
"comment":"Itemの表示倍率。",
"displayMagnification": 0.65
}

設定の直接編集方法

Text editorを使うのが一番簡単。
コマンドプロンプトから、次の形でファイル名として渡して呼び出し。
C:\><editor>.exe コピペ補助.hta:SettingData

例:C:\work> notepad.exe コピペ補助.hta:SettingData

ファイルごとの文字コードについて

Repositoryにある各ファイルは文字コードがそれぞれ違っている。

  • Batch file: Shift-JIS
  • Json file: UTF-16 LE BOM or non-BOM
  • HTA file: UTF-16 BOM
  • Markdown file: UTF-8 non-BOM

この状況は、そのファイルを使う環境がそれを求めるために発生している。
やはり、ファイル名に日本語は使うものじゃないな……

Footnotes

  1. 実際には copy しか補助しません。

  2. JSONファイルへのコメントとして、「JSON Perserは同じキーがある場合、大抵の環境では後のキーが有効になる」という動作を利用してコメントを入れている(JSON形式の公式定義では禁止されていたり明言されていなかったりらしい)。今回はHTAとして動かすので、IE11で動きさえすれば良い。

About

This HTA application that helps a little when your fingers are cramping up from frequent copying and pasting.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published