我想在Finder应用程序中刷新特定文件/文件夹的图标。所以我需要刷新所选目录。
我正在尝试使用AppleScript:
NSString *source=[NSString stringWithFormat:@"tell application \"Finder\" to update POSIX file\"%@\"",[NSString stringWithUTF8String:itemPath]];
NSAppleScript *update=[[NSAppleScript alloc] initWithSource:source];
NSDictionary *err;
[update executeAndReturnError:&err];
但它不适用于Mac OS 10.10(优胜美地)。 请建议任何替代方案。
任何帮助都是适当的.. !!
答案 0 :(得分:0)
夹具
如果你可以添加你得到的错误和itemPath
值来理解它会有所帮助。
这适用于10.10.3:
set x to path to desktop
tell application "Finder" to update x
谢