如何在查找器窗口(mac os 10.5)中刷新浏览器视图? [英] How to refresh browser view in finder window(mac os 10.5)?

查看:34
本文介绍了如何在查找器窗口(mac os 10.5)中刷新浏览器视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 mac os 10.5 上刷新 finder 的 NSBrowserView 中的所有 NSTableView.为了刷新图标视图、列表视图和流列表视图,我使用了苹果脚本.

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.....).

任何人都可以帮我吗?

推荐答案

它只刷新最后一列,因为每个 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

这是一个快速的解决方案,因为它一直上升到磁盘的根目录.理想情况下,它会停在最左侧列中显示的文件夹处,但我不知道如何确定它是哪个.

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.

这篇关于如何在查找器窗口(mac os 10.5)中刷新浏览器视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆