CotEditor
提供: MacWiki
2008年3月12日 (水) 23:32時点における130.158.211.34 (トーク)による版
CotEditor とは?
プレーンテキストのエディタ。OgreKit, Oniguruma の正規表現検索機能が組み込まれているとのことです。
Tips
- UTF-8 対応、AppleScript 対応とのことですので、下記のようなこともできます。
tell application "CotEditor" set string_utf8 to (contents of selection of front document) -- 置き換えを実行します -- なお、utf8toutf at http://www.fsci.fuk.kindai.ac.jp/aftp/pub/ptex/utils/ set (contents of selection of front document) to (do shell script "echo ¥"" & string_utf8 & "¥" | utf8toutf") end tell
- 新規文書 (ウィンドウ) を作成
set theText to "* " & ((current date) as string) & return tell application "CotEditor" activate if not (exists front document) then make new document if contents of front document is not "" then make new document set contents of front document to theText end tell
- 単語の数や文字数を数え上げる
tell front document of application "CotEditor" set theText to text of it -- set theText to contents of selection -- 選択範囲を処理 display dialog "ワードカウント結果" & return & return & ¬ "文字数:" & number of every character of theText & return & ¬ "単語数:" & number of every word of theText & return & ¬ "段落数:" & number of every paragraph of theText end tell
- 参考 URL