「CotEditor」の版間の差分

提供: MacWiki
移動: 案内検索
(Tips)
(Tips)
行16: 行16:
 
-- なお、utf8toutf at http://www.fsci.fuk.kindai.ac.jp/aftp/pub/ptex/utils/
 
-- なお、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")
 
set (contents of selection of front document) to (do shell script "echo ¥"" & string_utf8 & "¥" | utf8toutf")
 +
end tell
 +
</pre>
 +
 +
*新規文書 (ウィンドウ) を作成
 +
<pre>
 +
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
 
end tell
 
</pre>
 
</pre>

2008年3月12日 (水) 23:22時点における版

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

Wiki内の関連ページ