Skip to content

command query ppt

zmworm edited this page Apr 4, 2026 · 28 revisions

query - PowerPoint (.pptx)

Query selectors for PowerPoint documents.

Element Selectors

Selector Aliases Description
shape textbox Shapes and text boxes
title - Title shapes
picture pic Pictures
video - Videos
audio - Audio clips
equation math, formula Equations
table - Tables
chart - Charts
placeholder - Placeholders
connector connection Connectors
group - Groups
zoom - Zoom elements

Attributes

Attribute Applies To Description
font shapes Font name (exact match)
font!= shapes Font not equal
title shapes Is title shape (bool)
alt pictures Has alt text (bool)

Filter Operators

Operator Meaning Example
[attr] Exists (present and non-empty) [link]
= Exact match [style=Heading1]
!= Not equal [font!=Arial]
~= Contains text [text~=quarterly]
>= Greater or equal (numeric) [size>=24pt]
<= Less or equal (numeric) [size<=12pt]

Notes:

  • Can combine: shape[fill=FF0000][size>=24pt]
  • Color-aware: [fill=#FF0000] matches [fill=FF0000]
  • Dimension-aware: compares 2cm vs 1in correctly
  • Special keys text and type match node content and type
  • \!= accepted for zsh compatibility
  • Malformed selectors (unclosed brackets, empty [], invalid operators) now throw an error with suggestions instead of silently returning empty results

Pseudo-Selectors

Selector Description
:contains("text") Shape contains text (case-insensitive)
:text Shorthand for selecting shapes with text content
:no-alt Picture without alt text

Slide Prefix

Filter by slide: slide[2] > shape[font="Arial"]

Examples

# All shapes containing text
officecli query slides.pptx 'shape:contains("Revenue")'

# Pictures without alt text
officecli query slides.pptx "picture:no-alt"

# Title shapes
officecli query slides.pptx "title"

# Shapes on slide 2 with Arial
officecli query slides.pptx 'slide[2] > shape[font="Arial"]'

# Shapes not using Calibri
officecli query slides.pptx "shape[font!=Calibri]"

# All charts
officecli query slides.pptx "chart"

# All tables
officecli query slides.pptx "table"

# Shapes with text (shorthand)
officecli query slides.pptx "shape:text"

# All connectors
officecli query slides.pptx "connector"

# All groups
officecli query slides.pptx "group"

# Generic attribute filtering
officecli query slides.pptx 'shape[fill=#4472C4]'
officecli query slides.pptx 'shape[name~=Title]'

# Shapes wider than 10cm
officecli query slides.pptx "shape[width>=10cm]"

# Shapes containing "Summary" in text
officecli query slides.pptx "shape[text~=Summary]"

# Shapes that have a hyperlink
officecli query slides.pptx "shape[link]"

See Also


Based on OfficeCLI v1.0.33

Clone this wiki locally