Applescript仅适用于2个类似的mac中的1个

时间:2015-10-17 18:09:11

标签: applescript

在类似的mac上运行相同的脚本时出现了奇怪的结果:

-- write to textfile
on txt_write_to_file(theTextfile, theText, doAppend)
    set theFile to open for access theTextfile as text with write permission

    set appendthis to true
    if doAppend is false then
        set eof theFile to 0
    end if

    set theResult to writetext (theText as string) & return ¬
        to theFile ¬
        append appendthis ¬
        encoding "UTF-8"

    close access theFile
end txt_write_to_file

虽然它可以正常工作 10.10.4 Mac Script editor Version 2.7(176) 它导致另一个错误消息 10.10.5 Mac Script editor Version 2.7(176) (两者都没有插件)

"Expected end of line, etc. but found “to”."

- >这就是"将theResult .......设置为文件"

尝试没有换行 - 没有成功。

真的很感谢你的帮助!谢谢!!

1 个答案:

答案 0 :(得分:0)

命令Satimage.osax是脚本添加Satimage.osax的一部分 如果(~)/Library/ScriptingAdditons中未安装var arr = []; for (var tot = 0; tot < 4; tot++) { //creating empty arrays arr.push([]); for (var i = 0; i < 3; i++) { arr[tot].push(i); } } console.log(JSON.stringify(arr));,则会出现错误。