官方帮助文档FileStream Values部分有相关介绍.

fn format_txt filepath filetext =
(
    if doesFileExist filepath == true 
        then
    (
        fin = openfile filepath mode:"r+"
        seek fin #eof
        txt = filetext + "\n"
        format txt to:fin
        close fin
    )
    else
    (
        newfile = createFile filepath
        close newfile
        format_txt filepath filetext
        )
    )  -- 逐行写入文本
format_txt "C:\Users\Administrator\Desktop\2.txt" "你好MAXScript"

每次都会在文档结尾处写入,如果文件不存在则自动创建.

相关文章:

  • 2022-03-04
  • 2022-12-23
  • 2021-07-01
  • 2022-01-06
  • 2022-12-23
  • 2022-12-23
  • 2021-11-26
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
  • 2022-12-23
相关资源
相似解决方案