【发布时间】:2012-05-18 13:25:44
【问题描述】:
我正在为 Mac 开发一个可可应用程序。我正在使用我的应用程序在文件和文件夹上应用覆盖图标。但我的问题是,当我从我的应用程序更改文件或文件夹的图标时,它不会在 Finder 中反映它,除非我单击 Finder 中的任何文件或文件夹。为了刷新 Finder,我正在使用我的应用程序中的以下代码运行以下 applescript:
NSString *source=[NSString stringWithFormat:@"tell application \"Finder\" to update POSIX file \"%@\"",itemPath];
NSAppleScript *run = [[NSAppleScript alloc] initWithSource:source];
[run executeAndReturnError:nil];
但是这段代码并没有刷新我的 Finder。知道如何刷新 Finder 以立即反映文件或文件夹的图标吗???在此先感谢...
【问题讨论】:
-
@Amirinder Singh 你找到解决这个问题的方法了吗?
-
@jigs 实际上我已经完成了那个项目并解决了这个问题。但是现在我没有源代码,所以不记得解决方案是什么。
标签: cocoa applescript finder