你好,我尝试写了一个FinderSync程序,在通过:
var scriptsFolderURL: URL {
let manager = FileManager.default
var scriptsFolder: URL!
do {
scriptsFolder = try manager.url(for: .applicationScriptsDirectory, in: FileManager.SearchPathDomainMask.userDomainMask, appropriateFor: nil, create: true)
} catch {
print(error)
scriptsFolder = manager.urls(for: .applicationScriptsDirectory, in: .userDomainMask).first!
}
return scriptsFolder
}
获取scriptsFolderURL,manager.url(...)一直无法成功;
同时我通过NSOpenPanel将自己的scpt 拷贝进Library / Application Scripts/.../... 也无法成功,具体表现为let panel = NSOpenPanel() 后面的代码直接不再执行,我加了你上面提到的各种key-value,也无济于事,我使用的是mac os 11.4,能帮忙看下嘛?联系方式:wx:JsonRight
Mac开发App执行AppleScript沙盒里面运行AppleScript可不是那么简单,如下 项目的.entitlements文件记得要搞成这样,弄完了别忘了clean your project folder然后...