问题描述
我要刷新所有 NSTableView的
在 NSBrowserView
取景器在Mac OS 10.5。刷新图标视图,列表视图和流量列表视图中,我使用苹果脚本。
I want to refresh all NSTableView
in NSBrowserView
of finder on mac os 10.5. For refreshing icon view , list view and flow list view, i am using apple script.
@"tell application \"Finder\" to update every item in front window"
在浏览器中查看该脚本只刷新最后一列。
In browser view this script is only refreshing last column.
例如,此脚本仅刷新第三列(ICNS-copy.m .....)。
For example , this script is refreshing only third column(icns-copy.m.....).
任何人都可以请帮我吗?
Can anyone please help me out?
推荐答案
这只是令人耳目一新的最后一列,因为每一个Finder窗口在同一时间(其内容显示在最后一列)有且只有一个目标文件夹。解决的办法是走了文件夹层次结构并更新父文件夹为好。
It's only refreshing the last column because every Finder window has exactly one target folder at a time (whose content is displayed in the last column). The solution is to walk up the folder hierarchy and update the parent folders as well.
tell application "Finder"
set t to front window's target
repeat
try
update every item in t
set t to t's parent -- go one level up
on error -- e.g. when you reach root
exit repeat
end try
end repeat
end tell
这是一个quick'n'dirty解决方案,因为它会一路到磁盘的根目录。理想情况下,它将停止在其显示在最左边的列中的文件夹,但我无法弄清楚如何确定哪个大江它。
This is a quick'n'dirty solution since it goes up all the way to the disk's root. Ideally, it would stop at the folder which is displayed in the leftmost column, but I couldn't figure out how to determine which ohe it is.
这篇关于如何刷新Finder窗口(MAC OS 10.5)浏览器的看法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!