【问题标题】:Hide duplicate files in macOS search results?在 macOS 搜索结果中隐藏重复文件?
【发布时间】:2021-08-25 19:55:55
【问题描述】:

我不想删除重复文件,但我只想查看每个文件的一个实例。

在这种情况下,重复项之间的优先级无关紧要。

///

实际场景:

我想创建一个 VLC 播放列表,其中包含我曾经从特定域下载的每个视频。这些文件组织得不好,许多文件存在于我计算机上的多个位置。因此,Finder 搜索“来自”-> [域] 会返回许多重复文件。这意味着我不能只是将搜索结果拖放到 VLC 中而不会有很多重复。

我不想对文件本身进行重复数据删除。

我怎样才能做到这一点?

【问题讨论】:

  • 你是怎么搜索的,视频的名字是一样的吗?
  • 当视频是同一个文件时,它们确实具有相同的名称。我一直在 Finder 中使用“Where from”参数进行搜索,并将源域作为我的搜索词。

标签: macos terminal applescript macos-big-sur apple-m1


【解决方案1】:

无法在 Finder 搜索中隐藏重复项,因为在 Finder 搜索中没有过滤重复项的选项。

但您的工作是搜索,然后创建播放列表。这可以通过将您的选择拖放到下一个 droplet 上来完成,您可以将其称为“VLC Playlist Creator”。 (或使用 Automator 将其变成“制作 VLC 播放列表”服务)。它将为您过滤重复项并打开 VLC.app 的保存播放列表对话框。

on open theAliases
    set {namesList, moviesList} to {{}, {}}
    repeat with i from 1 to count theAliases
        set anAlias to item i of theAliases
        tell application "Finder" to set theName to name of anAlias
        if not (namesList contains theName) then
            set end of namesList to theName
            set end of moviesList to anAlias
        end if
    end repeat
    -- try to restart "VLC" to clear old playlist
    if running of application "VLC" then quit application "VLC"
    repeat while running of application "VLC"
        delay 0.1
    end repeat
    -- add movies to playlist
    tell application "VLC"
        open moviesList
        stop
        activate
    end tell
    -- save playlist dialog
    tell application "System Events" to keystroke "s" using command down
    tell application "VLC" to activate
end open

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-01-20
    • 1970-01-01
    • 2022-09-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-05
    相关资源
    最近更新 更多