返回顶部
p

profindProFind文件搜索

ProFind macOS 文件搜索技能 — 毫秒级索引搜索、文件内容全文检索、按大小/日期/类型筛选、批量操作

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
100
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

profind

ProFind 技能

macOS 文件搜索工具封装 — 支持 AppleScript 自动化、Shell 脚本钩子、URL Scheme 唤起和内置 HTTP API。

适用场景: 深度文件搜索、文件名/内容/元数据查询、按大小/日期/类型筛选、批量操作。



核心概念

ProFind 是 macOS 上的增强搜索工具,同时支持:

  • - Spotlight 索引搜索(毫秒级)
  • 文件系统扫描搜索(覆盖未索引位置)
  • AppleScript 自动化(与脚本钩子联动)
  • 内置 HTTP API(程序化搜索)
  • URL Scheme(从其他应用唤起)

ProFind 安装检查

bash
if [ -d /Applications/ProFind.app ]; then
echo ProFind 已安装: $(defaults read /Applications/ProFind.app/Contents/Info.plist CFBundleShortVersionString 2>/dev/null)
else
echo ProFind 未安装,请从 App Store 下载:https://apps.apple.com/app/id1559203395
fi



功能列表


功能说明
findfiles按文件名搜索,支持 glob/正则
findcontent
全文件内容搜索(支持 Spotlight 元数据) |
| find_advanced | 高级组合搜索(大小/日期/类型/UTI/标签等) |
| run_script | 执行 ProFind 脚本钩子处理搜索结果 |
| opensearchwindow | 打开 ProFind 搜索窗口(可预填查询词) |
| query_api | 通过 HTTP API 程序化搜索 |


搜索策略选择

用户查询 → 自动判断使用哪种搜索 → 执行

情况推荐策略
找已知名称的文件findfiles(Spotlight,毫秒级)
搜索文件内容/元数据
findcontent | | 需要多条件组合 | find_advanced | | 需要对结果批量操作 | run_script | | 需要 UI 交互 | opensearchwindow |

功能详解


1. find_files — 文件名搜索

基于 Spotlight 索引,毫秒级返回。

bash

基本搜索


osascript << EOF
tell application ProFind
activate
open location profind:search?name=test&path=~/Documents
end tell
EOF

在指定路径搜索(使用 find 命令找 ProFind 窗口内路径)

ProFind 支持通过 open location 唤起并传入搜索条件

URL Scheme 格式:

profind:search?name=<搜索词>&path=<路径>&scope=<范围>

参数说明示例
name搜索文件名test.txt、*.pdf
path
搜索根路径(可选) | ~/Documents、/Users/Admin | | scope | 搜索范围 | all、home、selected、hidden |

2. find_content — 内容/元数据搜索

使用 Spotlight 查询引擎,支持按内容、作者、UTI、元数据搜索。

bash
osascript << EOF
tell application ProFind
activate

-- 搜索文件名含 invoice 且大小 > 1MB 的 PDF
open location profind:search?name=invoice&kind=PDF&size=larger:1MB

-- 搜索内容含关键字(Spotlight 元数据查询)
open location profind:search?name=meeting&meta=content:brainstorm

-- 按修改日期搜索(最近 7 天内)
open location profind:search?name=report&date=modified:~week

-- 按标签搜索
open location profind:search?name=doc&label=red
end tell
EOF

URL 参数(内容/元数据搜索):

参数说明示例
kind文件类型PDF、image、document、folder
meta
Spotlight 元数据查询 | content:<词>、author:<人> |
| size | 文件大小 | larger:1MB、smaller:100KB、equal:5MB |
| date | 日期范围 | modified:~week、created:~month、~year、~3month |
| label | 标签颜色 | red、orange、yellow、green、blue、purple、gray |
| contains | 文件内容包含 | contains:text to find |


3. find_advanced — 高级组合搜索

ProFind 支持的高级搜索条件,通过 AppleScript 脚本直接构建搜索窗口内容。

bash
osascript << EOF
tell application ProFind
activate

-- 打开搜索窗口
set queryWin to make new query window with properties {search text:*.swift}

-- 设置高级搜索参数(通过 GUI 脚本或直接参数)
open location profind:search?name=*.swift&path=/Users&size=larger:0&date=modified:~month&scope=home

end tell
EOF

搜索条件速查:

条件URL 值说明
文件名包含name=test支持 glob *.pdf、正则 file[0-9]+
隐藏文件
scope=all | 包含隐藏文件 |
| 仅应用 | kind=application | 只搜应用 |
| 仅文件夹 | kind=folder | 只搜文件夹 |
| 排除文件夹 | exclude:/Volumes/Network | 排除指定路径 |
| 正则搜索 | name=regex:^doc_[0-9]{4}$ | 使用正则表达式 |
| Spotlight 查询 | kind=spotlightmetadata | 直接写 mdimporter 查询 |

常用文件类型(Kind):

PDF、document、image、movie、music、archive、code、application、folder

Spotlight 元数据类型:

content、author、comment、creator、title、subject、keyword、album、artist



4. run_script — 脚本钩子执行

ProFind 的脚本钩子(Script Actions)功能:搜索完成后对结果文件执行自定义脚本。

内置脚本钩子(Sample Scripts):

/Applications/ProFind.app/Contents/Resources/Sample Scripts/

脚本功能
Less In Terminal.scpt在 Terminal 用 less 分页查看路径
Move To Trash.scpt
将选中文件移至废纸篓 | | Say Paths.scpt | 朗读文件路径 | | Show Strings In Terminal.scpt | 显示文件的字符串资源 | | Open in iTunes.scpt | 在 iTunes 中打开音频文件 | | Word Count.shell | 统计文件字数 | | Print Paths.shell | 打印文件路径 | | mail.scpt | 发送文件路径邮件 | | duckduckgo.scpt | 用 DuckDuckGo 搜索文件名 |

通过 ProFind 菜单配置脚本:

  1. 1. 打开 ProFind → Scripts 菜单(或右键结果文件)
  2. 添加自定义脚本(AppleScript 或 Shell)
  3. 脚本接收参数:fileItem(当前文件)和 fileList(所有选中文件)

脚本接收的 AppleScript 参数:

参数名类型说明
currentFile / fileItemPOSIX file当前选中的文件路径
fileList
list of POSIX file | 所有选中的文件路径列表 |
| args / argsWithoutPaths | text | 用户传入的额外参数(空格分隔) |
| urlArguments | text | 解析后的 URL 参数 |
| numberOfArgs | integer | 参数个数 |

自定义脚本示例(Shell — 批量重命名):

bash
#!/bin/bash

ProFind Shell Script Hook 示例


放在 ~/Library/Scripts/ProFind/ 下即可在 ProFind 中调用

for file in $@; do
echo 处理文件: $file
# 替换空格为下划线
newname=$(echo $(basename $file) | sed s/ /_/g)
dir=$(dirname $file)
if [ $newname

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 profind-1775729881 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 profind-1775729881 技能

通过命令行安装

skillhub install profind-1775729881

下载

⬇ 下载 profind v1.0.0(免费)

文件大小: 19.32 KB | 发布时间: 2026-4-11 22:59

v1.0.0 最新 2026-4-11 22:59
Initial release — ProFind macOS file search with AppleScript, Shell hooks, URL scheme and HTTP API support

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部