coteditor script
TRANSCRIPT
入力の指定(AppleScript以外)• スクリプトの冒頭に以下を記述
• # %%%{CotEditorXInput=xxxx}%%%
• None : 入力なし
• Selection : 選択文字列
• AllText : ドキュメントのすべての文字列
出力の指定(AppleScript以外)• # %%%{CotEditorXOutput=xxxx}%%%
• Discard : 出力なし
• ReplaceSelection / ReplaceAllText
• InsertAfterSelection / AppendToAllText
• Pasteboard
例: カーソル位置に日付出力
#!/usr/bin/env ruby -Ku#%%%{CotEditorXInput=None}%%%#%%%{CotEditorXOutput=InsertAfterSelection}%%%!now = Time.nowprint now.strftime("%y-%m-%d")
AppleScriptの場合• 詳細は省略(後述のマニュアルを参照)
• CotEditor の機能の一部を利用可能
• 検索、置換、半角全角変換、ひらカタ変換
• エンコーディング変換、Unicode正規化
• キャレットの移動、スクロール