我有一个写在文本文件中的数字。是否可以在文本文件中添加另一个号码,然后用新号码替换旧号码?这是我的代码:
set theFile to POSIX path of "Users:Tyler:Documents:File.txt"
open for access theFile
set theFileContents to read theFile
set theNewFile to run script theFileContents + 1
tell application "TextEdit"
set eof of theFileContents to 0
write theNewFile to theFileContents