lov-finder-action

Featured

Generate Mac Finder right-click menu actions. Two modes: (A) Automator Quick Action for file/folder context menus, (B) Finder Sync Extension (Swift + xcodegen) for blank-space context menus. Automatically selects mode based on user intent. Trigger when user mentions "Finder右键", "右键菜单", "Quick Action", "Finder extension", "空白处右键", "新建文件", "context menu", or wants to add custom actions to Finder.

Data & Documents 65 stars 17 forks Updated today MIT

Install

View on GitHub

Quality Score: 89/100

Stars 20%
61
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# finder-action — Mac Finder 右键菜单动作生成器 根据用户描述生成 Finder 右键菜单动作,自动判断模式: | 场景 | 模式 | 技术方案 | |------|------|----------| | 右键**文件/文件夹** | Quick Action | Automator workflow | | 右键**空白处** | Finder Extension | Swift + xcodegen | ## 参数格式 `<动作名称> [触发描述]` 示例: - `pdf2png .pdf 将PDF所有页面纵向拼接成一张PNG` → Quick Action - `新建md文件 在空白处右键创建markdown文件` → Finder Extension ## 模式判断 关键词命中 → Finder Extension 模式: - 提到「空白处」「背景」「目录背景」「新建文件」「blank space」「background」 - 动作不需要选中文件即可触发 其他情况 → Quick Action 模式 --- ## Mode A: Quick Action(Automator workflow) ### Step 1: 分析需求 收集(缺失时 AskUserQuestion): - **动作名称**:右键菜单显示名 - **触发文件类型**:`.pdf`、`.md`、`.jpg` 等 - **核心命令**:用什么工具做什么 ### Step 2: 检查依赖 ```bash which <所需工具> ``` 不存在则提示 `brew install <tool>`。 ### Step 3: 生成 shell 脚本 ```bash #!/bin/bash for f in "$@"; do [[ "$f" == *.<ext> ]] || continue output="${f%.<ext>}.<out_ext>" <具体命令> "$f" -o "$output" done ``` - 工具路径用绝对路径(Quick Action 环境没有 `$PATH`) - `"$@"` 接收文件参数(inputMethod=1) ### Step 4: 创建 Automator workflow 创建 `~/Library/Services/<动作名称>.workflow/Contents/document.wflow`。 模板见 `references/automator-template.xml`。 关键配置: - `inputMethod`: `1` - `serviceInputTypeIdentifier`: `com.apple.Automator.fileSystemObject` - `workflowTypeIdentifier`: `com.apple.Automator.servicesMenu` ### Step 5: 验证注册 ```bash plutil -lint ~/Library/Services/<动作名称>.workflow/Contents/document.wflow /System/Library/CoreServices/pbs -update killall Finder ``` ### Step 6: Automator 保存(关键) ```bash open -a Automator ~/Library/Se...

Details

Author
lovstudio
Repository
lovstudio/skills
Created
5 months ago
Last Updated
today
Language
Python
License
MIT

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category