我正在尝试使用 NSFileManager。我知道我可以在没有 NSFileManager 的情况下做到这一点,这超出了这个问题的范围
use framework "Foundation"
set temporaryDirectory to URLForDirectory_inDomain_appropriateForURL_create_error_(NSItemReplacementDirectory of current application, NSUserDomainMask of current application, (fileURLWithPath_isDirectory_("/", true) of class "NSURL" of current application), true, nil) of defaultManager of class "NSFileManager" of current application
以下是重新格式化后的版本:
set temporaryDirectory
to URLForDirectory_inDomain_appropriateForURL_create_error_(
NSItemReplacementDirectory of current application,
NSUserDomainMask of current application,
(fileURLWithPath_isDirectory_("/", true) of class "NSURL" of current application),
true,
nil
)
of defaultManager of class "NSFileManager" of current application
这是我得到的错误
error "The variable nil is not defined." number -2753 from "nil"