OS X で特殊文字を挿入する最も簡単な方法は何ですか?

OS X で特殊文字を挿入する最も簡単な方法は何ですか?

コミュニケーションの中で「親指を立てた」Unicode 絵文字を使いたいです。

いいぞ

AppleScript など、特殊文字パレットを開かずにこれを行う簡単な方法はありますか? 奇妙な Unicode キー シーケンス (これについては調べてみましたが、複雑すぎるようです。さらに、キーボード レイアウトを変更する必要があります)? キー ショートカット用の組み込みユーティリティ? キー ショートカット用のサード パーティ ユーティリティ?

答え1

最も簡単な選択肢の一つは、テキストエクスパンダーテキスト ファイルで略語を設定し、グループとしてインポートすることもできます。

また、長押しポップオーバーに文字を追加する

利用したファストスクリプトこのスクリプトにショートカットを割り当てるには:

try
    set old to the clipboard as record
end try
try
    tell application "System Events"
        key code 123 using {option down, shift down}
        keystroke "c" using command down
    end tell
    delay 0.05
    set input to the clipboard
    if input contains return then error
    set p1 to read POSIX file "/Users/lauri/Notes/snippets.txt" as «class utf8» using delimiter linefeed
    set p2 to read POSIX file "/Users/lauri/Projects/unicode/html_entities.txt" as «class utf8» using delimiter linefeed
    repeat with p in p1 & p2
        considering case
            if p starts with (input & " ") then
                set the clipboard to text ((offset of space in p) + 1) thru -1 of p
                tell application "System Events" to keystroke "v" using command down
                delay 0.05
                exit repeat
            end if
        end considering
    end repeat
end try
try
    set the clipboard to old
end try

html_entities.txtHTML 文字参照に使用される略語のリストです。

~/Library/KeyBindings/次のようにプロパティリストを作成して保存することもできます。デフォルトキーバインディング.dictα. アプリケーションを再度開いた後、⌥A で.が挿入されるはずですが、その上の または 文字insertText:では機能しないようですU+10000

{
    "~a" = (insertText:, "α");
}

関連情報