Obsidian plugin: see where attachments are used, find broken attachment links, and repair them one at a time after reviewing the exact change.
翻译准备中
正在加载完整 README。
查看完整 README ↗| 🔍 Scanning never changes files | Attachment Lens only reads your vault until you choose Apply repair. |
| ✋ Nothing happens automatically | No replacement is ever chosen for you. You pick it, review it, then apply it. |
| 🎯 One reference per repair | A repair changes the characters of one link in one file. Everything else stays as it is, down to spacing and line endings. |
| 🛡️ Checked before and after writing | If the note changed since you looked at the preview, nothing is written. After writing, the file is read back to confirm the result. |
| ↩️ Undo that survives a restart | Undo last repair puts the original text back, also after you close Obsidian. It refuses if you've edited the file since, so newer work is never overwritten. |
| 📎 Attachments are never touched | No renaming, moving or deleting of attachment files, ever. |
| 🔒 Private | No network requests, no accounts, no telemetry. |
The quickest way: open Attachment Lens in the Community directory and choose Add to Obsidian. Obsidian opens the plugin's page, where you choose Install, then Enable.
Or from inside Obsidian:
Attachment Lens needs Obsidian 1.14 or newer on Windows, macOS or Linux. A mobile version is planned.
main.js, manifest.json and styles.css..obsidian/plugins/attachment-lens/ (if you renamed Obsidian's configuration folder, use that instead of .obsidian).Click the paperclip in the left ribbon, or run Attachment Lens: Open from the command palette (Ctrl/Cmd+P). The panel opens as a tab. Choose Scan vault.
The scan reads your notes, properties, Canvas boards and bases. It runs in small steps, so you can keep working, and Cancel scan stops it at any time. After the first scan, the results follow your changes automatically.
| Part | What it's for |
|---|---|
| Search | Type part of a file name or folder. Ctrl/Cmd+F jumps here. |
| Filters | All attachments, Broken references, No references detected and Uncertain references, each with a live count. |
| All types and Sort | Show only images, PDFs, audio, video, documents or archives, and sort by name, folder, size, date or number of references. |
| The list | Every attachment with its folder, size and number of references. Click a row or use the arrow keys. |
| Details | A preview for images, the path (with a copy button), type, size and date, and every place the file is used. Open source takes you to the exact line. |
Choose Broken references. Each row is a file that's linked somewhere but doesn't exist. Select one, then choose Repair… on the reference you want to fix.
Pick the file you meant. Suggestions are ranked by how similar their names and folders are, and each one says why it's there, for example Same name, .jpg instead of .jpeg. If the right file isn't listed, search all attachments underneath. When you've chosen, select Review change.
The review dialog shows exactly what will change, highlighted in context. Nothing is written yet. Choose Apply repair to write it, or Back to choose another file.
The banner confirms the repair was checked after writing. Changed your mind? Choose Undo repair.
| Filter | Shows |
|---|---|
| All attachments | Every attachment in the vault. |
| Broken references | Links to attachments that don't exist, grouped by the missing file. The count is the number of broken links. |
| No references detected | Attachments that nothing links to, as far as Attachment Lens can see. This doesn't prove a file is unused, because some places (such as HTML tags or plugin code) aren't scanned. See What gets scanned. |
| Uncertain references | Plain text that looks like a file name but isn't a link, such as a banner: dune.jpg property that a theme reads. |
When a link is broken, Attachment Lens compares the missing name with every attachment in the vault. It looks at:
.jpeg and .jpg,photo 1.png, photo-copy.png),results-table-v2 and results-table-v3,Each suggestion shows the reasons that apply. A file of a different type is marked in orange. Similar names are a hint, not proof, so check the preview before you choose.
以上为 README 的开头部分。其余内容请阅读原文。 查看完整 README ↗