Run3 Save Modified Word Document to Disk
Use this skill to write a modified python-docx Document object back to a .docx file, handling file paths and permissions correctly.From its SKILL.md
npx -y skills add cxcscmu/SkillLearnBench --skill run3_Save-Modified-Word-Document-to-DiskAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
0.7 KB, 107 tokens by cl100k_base, as published. Nobody here has run it
Algorithm
def save_document(doc, output_path):
try:
doc.save(output_path)
return True
except Exception as e:
raise IOError(f"Failed to save document to {output_path}: {e}")
Key Details
- The output path should be an absolute or relative path to the desired
.docxfile doc.save()overwrites existing files- Ensure the output directory exists or the parent path is writable
- Catch and report errors explicitly for debugging
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.