#!/usr/bin/env python3 """Generated OfficeCLI script for nexora-pulse-memo.docx""" import json, subprocess, tempfile, os FILE = "nexora-pulse-memo.docx" def batch(commands): with tempfile.NamedTemporaryFile(mode="w", suffix=".json", delete=False) as f: json.dump(commands, f) f.flush() result = subprocess.run( ["officecli", "batch", FILE, "--input", f.name], capture_output=True, text=True ) os.unlink(f.name) if result.returncode != 0: print(result.stderr or result.stdout) raise RuntimeError(f"Batch failed: {result.returncode}") print(result.stdout, end="") subprocess.run(["officecli", "create", FILE], check=True) # Turn 1: memo-batch batch(json.loads('[\n {\n "command": "set",\n "path": "/",\n "props": {\n "title": "Internal Memo \\u2013 Nexora Pulse Launch",\n "author": "Sarah Chen"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "INTERNAL MEMO",\n "style": "Heading1",\n "align": "center"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": ""\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "To: All Company Staff"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "From: Sarah Chen, Marketing Manager"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Date: April 5, 2026"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Re: Nexora Pulse Product Launch"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": ""\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "We are excited to announce the upcoming launch of Nexora Pulse, our new customer analytics dashboard designed to provide real-time insights and help our teams make data-driven decisions faster than ever."\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": ""\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Launch Date: Nexora Pulse will officially go live on April 22nd. Mark your calendars!"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": ""\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Company-Wide Demo: Join us on April 18th at 2:00 PM for a live walkthrough of the platform. This is a great opportunity to see Nexora Pulse in action, ask questions, and get familiar with the features before launch. All staff are encouraged to attend."\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": ""\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "We look forward to sharing this milestone with the entire team. Please reach out to the Marketing team if you have any questions in the meantime."\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": ""\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Best regards,"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Sarah Chen"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Marketing Manager"\n }\n }\n]')) # Turn 2: replace-demo-time batch(json.loads('[\n {\n "command": "set",\n "path": "/",\n "props": {\n "find": "2:00 PM",\n "replace": "3:00 PM"\n }\n }\n]')) subprocess.run(["officecli", "validate", FILE], check=True) print(f"\nDone: {FILE}")