Problem
The insert_text() function currently treats all inserted content as a single continuous paragraph, preventing granular style application.
Current Behavior
insert_text(
text_frame_index=0,
text="CHAPTER 1\n\nNew York Harbor\n\nIn the beginning...",
page_index=0
)
Result:
- ✅ All content inserted successfully
- ❌ All content treated as one paragraph
- ❌ Cannot apply different styles to different sections
- ❌ Chapter title gets same formatting as body text
- ❌ Scene breaks ("* * *") cannot be centered separately
Desired Behavior
Should preserve paragraph structure from the text input:
- Paragraph 1: "CHAPTER 1" → Apply "Chapter Title" style
- Paragraph 2: "New York Harbor" → Apply "Location" style
- Paragraph 3: "In the beginning..." → Apply "Body Text" style
Workaround
Use insert_formatted_paragraphs() instead:
insert_formatted_paragraphs(
text_frame_index=0,
page_index=0,
paragraphs=[
{"text": "CHAPTER 1", "style": "Chapter Title Large"},
{"text": "New York Harbor", "style": "Chapter Location Italic"},
{"text": "In the beginning...", "style": "Body First Drop"}
]
)
Limitation of workaround: Requires pre-parsing text into paragraphs with style assignments.
Proposed Solutions
Option 1: Parse newlines as paragraph breaks in insert_text()
Modify insert_text() to:
- Split text by
\n\n (double newlines)
- Create actual InDesign paragraphs for each section
- Allow subsequent
apply_paragraph_style() calls to target specific paragraphs
Option 2: Add optional paragraph style mapping parameter
insert_text(
text_frame_index=0,
text="CHAPTER 1\n\nNew York\n\nIn the beginning...",
paragraph_styles=["Chapter Title", "Location", "Body Text"]
)
Option 3: Document current behavior clearly
Update tool documentation to clarify:
insert_text() is for uniform formatting only
- Use
insert_formatted_paragraphs() for mixed formatting
- Provide clear examples of when to use each
Impact
Severity: Medium
Workaround exists: Yes (insert_formatted_paragraphs())
Affects: Users expecting paragraph-aware formatting from plain text insertion
Files Involved
adobe_mcp/indesign/server.py - insert_text() tool
uxp-plugins/indesign/commands/text.js - insertText handler
- Documentation to update if behavior is intentional
Related
- Tool added in commit f188798
insert_formatted_paragraphs() added in commit 8ea7aed as solution
Problem
The
insert_text()function currently treats all inserted content as a single continuous paragraph, preventing granular style application.Current Behavior
Result:
Desired Behavior
Should preserve paragraph structure from the text input:
Workaround
Use
insert_formatted_paragraphs()instead:Limitation of workaround: Requires pre-parsing text into paragraphs with style assignments.
Proposed Solutions
Option 1: Parse newlines as paragraph breaks in insert_text()
Modify
insert_text()to:\n\n(double newlines)apply_paragraph_style()calls to target specific paragraphsOption 2: Add optional paragraph style mapping parameter
Option 3: Document current behavior clearly
Update tool documentation to clarify:
insert_text()is for uniform formatting onlyinsert_formatted_paragraphs()for mixed formattingImpact
Severity: Medium
Workaround exists: Yes (
insert_formatted_paragraphs())Affects: Users expecting paragraph-aware formatting from plain text insertion
Files Involved
adobe_mcp/indesign/server.py-insert_text()tooluxp-plugins/indesign/commands/text.js-insertTexthandlerRelated
insert_formatted_paragraphs()added in commit 8ea7aed as solution