File Info: metadata templates save, import and list from the File Info menu

File Info's menu saves the fields as an XMP metadata template (into the
Metadata Templates folder next to the preferences, or any file), imports
one with a choice of three merges, lists the saved templates and opens
the folder. The import is one undo step and records nothing when no
field changes.

- file.info.saveTemplate writes the title (when it is not the
  document's name), author, author title, description, keywords,
  rating, copyright status, notice and URL that have a value.
- file.info.applyTemplate reads a file, a saved template or XMP text
  (at most 8 MB) and merges it: replace clears the fields first, keep
  takes each field the template has, append adds keywords and fills
  only empty fields. apply: false returns the merged fields without
  changing the document.
- file.info.templates lists the folder's .xmp files.
- A PDF or .ai also opens with the rating and author title its XMP
  packet gives.

Docs: docs/mcp.md, docs/target-app-parity.md.
This commit is contained in:
dotCooCoo
2026-11-15 11:05:55 -08:00
parent 0c1ac3bdc5
commit a670cd1102
43 changed files with 1273 additions and 18 deletions
+2 -1
View File
@@ -238,10 +238,11 @@ fn main() -> ExitCode {
/// A headless session that remembers what the user keeps between runs: the PDF presets saved, the
/// ICC profiles loaded, the plug-ins installed (#2168, #2174, #2541), the custom dictionary's words (#4936) and the Color Settings (#6335), in the folders
/// and files next to the preferences that the desktop app uses too, and lists the scripts of the Scripts folder there
/// (`script.listInstalled`) and starts new documents from the New Document profiles there. `VECTORCRAFT_NO_PREFS` and
/// (`script.listInstalled`), keeps File Info's metadata templates there and starts new documents from the New Document profiles there. `VECTORCRAFT_NO_PREFS` and
/// `VECTORCRAFT_CONFIG_DIR` apply as they do there.
fn with_stores(mut h: Headless) -> Headless {
prefs_dir::attach_scripts_dir(&mut h.session);
prefs_dir::attach_metadata_templates_dir(&mut h.session);
prefs_dir::attach_new_doc_profiles(&mut h.session);
prefs_dir::attach_profile_store(&mut h.session);
prefs_dir::attach_color_settings(&mut h.session);