#!/usr/bin/env python3 """Generated OfficeCLI script for allhands.docx""" import json, subprocess, tempfile, os FILE = "allhands.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: allhands-batch-turn1 batch(json.loads('[\n {\n "command": "set",\n "path": "/",\n "props": {\n "title": "Q2 All-Hands \\u2014 April 11, 2026",\n "author": "Internal Communications"\n }\n },\n {\n "command": "add",\n "parent": "/styles",\n "type": "style",\n "props": {\n "id": "TealHeading1",\n "name": "TealHeading1",\n "type": "paragraph",\n "basedOn": "Heading1",\n "font": "Calibri",\n "size": "18",\n "bold": "true",\n "color": "0D9488",\n "spaceBefore": "240",\n "spaceAfter": "60"\n }\n },\n {\n "command": "add",\n "parent": "/styles",\n "type": "style",\n "props": {\n "id": "TealHeading2",\n "name": "TealHeading2",\n "type": "paragraph",\n "basedOn": "Heading2",\n "font": "Calibri",\n "size": "14",\n "bold": "true",\n "color": "0D9488",\n "spaceBefore": "200",\n "spaceAfter": "40"\n }\n },\n {\n "command": "add",\n "parent": "/styles",\n "type": "style",\n "props": {\n "id": "AgendaBody",\n "name": "AgendaBody",\n "type": "paragraph",\n "basedOn": "Normal",\n "font": "Calibri",\n "size": "11",\n "spaceBefore": "60",\n "spaceAfter": "60"\n }\n },\n {\n "command": "add",\n "parent": "/styles",\n "type": "style",\n "props": {\n "id": "TimeBlock",\n "name": "TimeBlock",\n "type": "paragraph",\n "basedOn": "Normal",\n "font": "Calibri",\n "size": "10",\n "italic": "true",\n "color": "0D9488",\n "spaceBefore": "40",\n "spaceAfter": "20"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Q2 All-Hands \\u2014 April 11, 2026",\n "style": "Normal",\n "font": "Calibri",\n "size": "28",\n "bold": "true",\n "color": "0D9488",\n "alignment": "center",\n "spaceBefore": "0",\n "spaceAfter": "60",\n "pbdr.bottom": "single;12;0D9488;6"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "April 11, 2026 \\u2022 All-Hands Meeting",\n "style": "Normal",\n "font": "Calibri",\n "size": "11",\n "italic": "true",\n "color": "555555",\n "alignment": "center",\n "spaceBefore": "0",\n "spaceAfter": "240"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Welcome & Logistics",\n "style": "TealHeading1"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Duration: 10 minutes",\n "style": "TimeBlock"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Opening remarks, housekeeping notes, and a brief overview of today\\u2019s agenda. All attendees are encouraged to join on time and keep cameras on.",\n "style": "AgendaBody"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Please ensure your microphone is muted when not speaking and use the chat window or hand-raise feature for questions during each segment.",\n "style": "AgendaBody"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "CEO Update",\n "style": "TealHeading1"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Duration: 20 minutes",\n "style": "TimeBlock"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "A strategic overview of company performance for Q1 2026, key priorities for Q2, and a look ahead at goals for the remainder of the fiscal year.",\n "style": "AgendaBody"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "The CEO will address recent market developments and outline the initiatives the organization is investing in to drive sustainable growth.",\n "style": "AgendaBody"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Team Highlights",\n "style": "TealHeading1"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Duration: 15 minutes",\n "style": "TimeBlock"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Spotlighting outstanding work and milestones from teams across the organization during the past quarter. Each featured team will share a brief summary of their achievement.",\n "style": "AgendaBody"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Nominations for team highlights were collected in advance. If your team was selected, a speaker will present for approximately 2\\u20133 minutes.",\n "style": "AgendaBody"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Open Q&A",\n "style": "TealHeading1"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Duration: 15 minutes",\n "style": "TimeBlock"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "An open forum for employees to ask questions of leadership. Questions may be submitted anonymously via the meeting chat or asked live using the hand-raise feature.",\n "style": "AgendaBody"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "We will do our best to address as many questions as possible within the allotted time. Unanswered questions will be compiled and addressed in a follow-up email.",\n "style": "AgendaBody"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Closing Remarks",\n "style": "TealHeading1"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "Duration: 5 minutes",\n "style": "TimeBlock"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "A brief wrap-up to thank participants for their time and engagement. Key takeaways and any action items will be summarized for the team.",\n "style": "AgendaBody"\n }\n },\n {\n "command": "add",\n "parent": "/body",\n "type": "paragraph",\n "props": {\n "text": "A recording of this meeting and a summary document will be distributed to all employees within 48 hours of the session.",\n "style": "AgendaBody"\n }\n },\n {\n "command": "add",\n "parent": "/",\n "type": "footer",\n "props": {\n "text": "Confidential \\u2014 Internal Use Only",\n "alignment": "center",\n "font": "Calibri",\n "size": "9",\n "italic": "true",\n "color": "777777"\n }\n },\n {\n "command": "add",\n "parent": "/footer[1]/p[1]",\n "type": "run",\n "props": {\n "text": " | Page ",\n "font": "Calibri",\n "size": "9",\n "italic": "true",\n "color": "777777"\n }\n },\n {\n "command": "add",\n "parent": "/footer[1]/p[1]",\n "type": "pagenum",\n "props": {\n "font": "Calibri",\n "size": "9",\n "italic": "true",\n "color": "777777"\n }\n }\n]')) # Turn 2: allhands-batch-turn2 batch(json.loads('[\n {\n "command": "set",\n "path": "/",\n "props": {\n "find": "Duration: 10 minutes",\n "bold": "true"\n }\n },\n {\n "command": "set",\n "path": "/",\n "props": {\n "find": "Duration: 20 minutes",\n "bold": "true"\n }\n },\n {\n "command": "set",\n "path": "/",\n "props": {\n "find": "Duration: 15 minutes",\n "bold": "true"\n }\n },\n {\n "command": "set",\n "path": "/",\n "props": {\n "find": "Duration: 5 minutes",\n "bold": "true"\n }\n }\n]')) subprocess.run(["officecli", "validate", FILE], check=True) print(f"\nDone: {FILE}")

AltStyle によって変換されたページ (->オリジナル) /