- 投稿日 : 2006-09-22
- 更新日 : 2006-09-22
- AppleScript
変数の内容をテキストファイルに書き出す ( 追記 ) する AppleScript のサンプルです。
デスクトップに「test.txt」と言う名前のファイルが存在しない場合、新規作成します。ファイルが既に存在していれば追記。
tell application "Finder"
set aText to ("日本語のサンプル文字列" & return)
set aTextFile to open for access ((desktop as text) & "test.txt") with write permission
set aEOF to get eof of aTextFile
try
write aText starting at (aEOF + 1) to aTextFile
on error aErrorText
display dialog aErrorText
end try
close access aTextFile
end tell
日本語を書き出す時、文字コードはどうなるんだろう?
動作確認:Mac OS 10.4.7
Comments:2
-
ツムラ
10-06-15 (火) 18:02 -
サンキュー サー!!
サー イェッサー !!クリップボードをテキストファイルに書き出すスクリプトをつくっています。
参考にします。ありがとうございます。 -
Bowz
10-06-15 (火) 19:59 -
ツムラさん、コメントありがとうございます。
お役に立てて嬉しいです。
Trackbacks:0
- Trackback URL for this entry
- http://bowz.info/1239/trackback
- Listed below are links to weblogs that reference
- [ AppleScript ] 変数の内容をテキストファイルに書き出すサンプル from Bowz::Notebook
Additional comments powered by BackType
- Newer: Movable Type で特別なページを作る方法
- Older: ページを印刷する JavaScript のサンプル