2
在AppleScript中,我经常需要在文件之间转换为POSIX路径和AppleScript的本机文件别名。如何使用JXA中的POSIX路径
的方式做到这一点是通过在标准添加了POSIX文件类:
set aFile to POSIX file "/"
get aFile's POSIX path
如何做这些JXA石膏/转化?我试过
var app = Application.currentApplication();
app.includeStandardAdditions = true;
app.POSIXFile().make('/');
但我只得到
Error on line 4: Error: POSIXFile is not a valid class for application «Appname»