0298名称未設定
2014/12/10(水) 18:24:44.28ID:8lxhxVtu0CotEditor(Ver.1)ならこれで動きます(Applescriptはアプリごとに使える命令が違う)
CotEditor2はOS10.6で動かないからすぐにはチェックできない…
--CotEditorでファイルを開いて文末に日時を挿入
--ファイルパスの例"/Users/ユーザー名/Desktop/ファイル名.txt"
set filePath to "ファイルパス" as POSIX file
tell application "CotEditor"
activate
open file filePath
tell front document
-- カーソルをドキュメントの末尾に移動
set docLen to length
set range of selection to {docLen, 0}
--末尾に日時を挿入
set contents of selection to return & return & return & return & "---" & (current date) & "---"
--日時挿入した行の2行上にカーソルを移動
set theRange to range of selection
scroll to caret
set item 1 of theRange to (item 1 of theRange) + 2
set item 2 of theRange to 0
set range of selection to theRange
end tell
end tell