Web検索しても、なんかわかりづらかったけれども、とりあえず、ファイルを読み込むのと書き出しのテストとしてはこんな感じ。
この例は、単純に「readtest.txt」の中身を全部読み出して、「writetest.txt」に書き出すというもの
前半のファイル読み込み部分だけ、Automatorの中のAppleScriptに組み込んだら、ちゃんとファイルから読み込んだ値で、ブラウザのテキストフィールドに入力できた。
『
set theReadFile to "/(フルパス)/readtest.txt"
open for access theReadFile without write permission
set theText to read theReadFile
close access theReadFile
set theWriteFile to "/(フルパス)/writetest.txt" as POSIX file
open for access theWriteFile with write permission
write theText to theWriteFile
close access theWriteFile
』
補足
・「read」(3行目)を使う場合は2行目(openの行)と4行目(closeの行)は
無くても良い
・1行目に無くて、6行目にある「as POSIX file」は、UNIXでの形式のパス指定
では付けるものらしいけれど、無くても問題無かったので、1行目は付けていない。
ログインしてコメントを確認・投稿する