Skip to content
cccskills
FreePublished on GitHub

mdfind

Search PDF, PPTX, and image content in Attachments using macOS Spotlight

The English summary is being prepared. Showing the original description.

Works withPowerPoint
See how to install

Files included (1)

  • SKILL.md2.1 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

/mdfind - Attachment Content Search

Search inside PDFs, PowerPoints, images, and other files in Attachments/ using macOS Spotlight (mdfind). This leverages the OS-level content index — no custom indexing needed.

Usage

/mdfind <search query>           # Search all attachment content
/mdfind --type pdf <query>       # Search only PDFs
/mdfind --type pptx <query>      # Search only PowerPoints
/mdfind --type image <query>     # Search only images (OCR-indexed)

Instructions

1. Run mdfind

Execute the appropriate search based on flags:

Default (all attachments)

mdfind -onlyin Attachments/ "<search_query>" 2>/dev/null

Filter by PDF

mdfind -onlyin Attachments/ "kMDItemContentType == 'com.adobe.pdf' && kMDItemTextContent == '*<query>*'" 2>/dev/null

If the above returns nothing, fall back to the simpler form:

mdfind -onlyin Attachments/ -name ".pdf" "<search_query>" 2>/dev/null

Filter by PPTX

mdfind -onlyin Attachments/ "kMDItemContentType == 'org.openxmlformats.presentationml.presentation'" "<search_query>" 2>/dev/null

Filter by Images

mdfind -onlyin Attachments/ "kMDItemContentType == 'public.image'" "<search_query>" 2>/dev/null

2. Present Results

Format results clearly:

## Attachment Search: <query>

Found **N** matching files

| # | File | Type | Size |
|---|------|------|------|
| 1 | [filename](path) | PDF | 2.4 MB |
| 2 | ... | ... | ... |

### Quick Actions

- Read a PDF: `/pdf-to-page <path>`
- Read a PPTX: `/pptx-to-page <path>`
- Full vault search: `/q <query>`

3. Get File Details (Optional)

For each result, get file size and type:

ls -lh "<file_path>" 2>/dev/null

Notes

  • mdfind uses macOS Spotlight — files must be indexed (most are by default)
  • Works best with text-based PDFs; scanned PDFs need OCR indexing
  • For vault note content search, use /q instead
  • Results are file paths relative to the vault root

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Batch populate summary fields using content analysis

The English summary is being prepared. Showing the original description.

DavidROliverBA/ArchitectKB53Updated Mar 2, 2026

Batch auto-tag untagged notes using content analysis

The English summary is being prepared. Showing the original description.

DavidROliverBA/ArchitectKB53Updated Mar 2, 2026

Generate C4 architecture diagrams from system notes

The English summary is being prepared. Showing the original description.

DavidROliverBA/ArchitectKB53Updated Mar 2, 2026

canvas

Free

Create and edit Obsidian Canvas files for architecture visualization

The English summary is being prepared. Showing the original description.

DavidROliverBA/ArchitectKB53Updated Mar 2, 2026

Check Outlook inbox and update daily note with message summary

The English summary is being prepared. Showing the original description.

DavidROliverBA/ArchitectKB53Updated Mar 2, 2026

commit

Free

Stage and commit vault changes with UK English conventional commit messages

The English summary is being prepared. Showing the original description.

DavidROliverBA/ArchitectKB53Updated Mar 2, 2026

See all skills by DavidROliverBA

Report a problem with this skill