Repository Public
1#!/bin/bash2# ORIX Docs3# File: Scripts/screenshots.sh4# Description: Captures the documentation screenshots from the running application. Each image is the app's own window, rendered by AppKit5# (LaunchOptions.snapshot); nothing is composited or retouched. Usage: Scripts/screenshots.sh [name…]6#7# Author: Simon-Pierre Boucher8# Contact: contact@spboucher.ai9set -uo pipefail10cd "$(dirname "$0")/.."11APP="${ORIX_APP:-build/DerivedData/Build/Products/Debug/ORIX Docs.app}/Contents/MacOS/ORIX Docs"12OUT="$PWD/docs/screenshots"; mkdir -p "$OUT" build/shots13BASE=(-ApplePersistenceIgnoreState YES -AppleLanguages "(en)" -AppleLocale en_CA -defaultLanguage en -defaultPaper "US Letter" -reviewerName "Ada Lovelace" -organization "Northwind Research" -checkSpelling NO -ORIXWidth 1440 -ORIXHeight 900)14ONLY=("$@")15shot() { # shot <name> <args…>16 local name="$1"; shift17 if [[ ${#ONLY[@]} -gt 0 && ! " ${ONLY[*]} " =~ " $name " ]]; then return; fi18 rm -f "$OUT/$name.png"19 "$APP" "${BASE[@]}" "$@" -ORIXSnapshot "$OUT/$name.png" >/dev/null 2>&1 &20 local pid=$!21 for _ in $(seq 1 90); do kill -0 $pid 2>/dev/null || break; sleep 1; done22 kill -9 $pid 2>/dev/null23 [[ -f "$OUT/$name.png" ]] && echo "ok $name ($(sips -g pixelWidth -g pixelHeight "$OUT/$name.png" | awk '/pixel/{printf "%s ", $2}'))" || echo "FAIL $name"24}2526cat > build/shots/original.md <<'MD'27# Quarterly Review2829## Summary3031Revenue grew by 8 % over the quarter, driven by the renewal of three enterprise contracts. Operating costs remained stable.3233The hiring plan is on schedule. Two engineers joined the platform team in May.3435## Risks3637Supplier delays could affect the hardware roadmap. The team monitors lead times every week.3839| Item | Q1 | Q2 |40|---|---|---|41| Revenue | 1 200 | 1 296 |42| Costs | 800 | 804 |4344## Next steps4546Finalise the budget for the second half of the year.47MD48cat > build/shots/revised.md <<'MD'49# Quarterly Review5051## Summary5253Revenue grew by 9 % over the quarter, driven mainly by the renewal of three enterprise contracts. Operating costs remained stable.5455## Risks5657Supplier delays could affect the hardware roadmap. The team now monitors lead times twice a week and keeps a second source for critical parts.5859The hiring plan is on schedule. Two engineers joined the platform team in May.6061| Item | Q1 | Q2 |62|---|---|---|63| Revenue | 1 200 | 1 308 |64| Costs | 800 | 804 |6566## Next steps6768Finalise the budget for the second half of the year and present it to the board in September.69MD7071shot 01-main-editor -ORIXTemplate research-report -ORIXMode writing -ORIXSidebar outline -ORIXInspector format -ORIXPage 372shot 02-writing-mode -ORIXTemplate book-manuscript -ORIXMode writing -ORIXHideInspector YES -ORIXSidebar outline -ORIXPage 573shot 03-page-layout -ORIXTemplate thesis -ORIXMode pageLayout -ORIXSidebar pages -ORIXInspector document -ORIXZoom 0.7 -ORIXPage 974shot 04-typography-studio -ORIXTemplate academic-paper -ORIXMode writing -ORIXInspector format -ORIXDemo select -ORIXHideSidebar YES75shot 05-tables -ORIXTemplate financial-report -ORIXMode writing -ORIXInspector table -ORIXDemo cells -ORIXHideSidebar YES76shot 06-equation-editor -ORIXTemplate academic-paper -ORIXMode academic -ORIXDemo equation -ORIXSheet equation-edit -ORIXSnapshotDelay 377shot 07-academic-writing -ORIXTemplate academic-paper -ORIXMode academic -ORIXSidebar outline -ORIXInspector academic -ORIXPage 278shot 08-citation-manager -ORIXTemplate academic-paper -ORIXMode academic -ORIXSheet citation -ORIXSnapshotDelay 379shot 09-review-mode -ORIXTemplate research-report -ORIXMode review -ORIXSidebar review -ORIXInspector audit -ORIXDemo review -ORIXAudit YES -ORIXSnapshotDelay 580shot 10-track-changes -ORIXTemplate research-report -ORIXMode review -ORIXSidebar review -ORIXHideInspector YES -ORIXDemo review -ORIXZoom 1.381shot 12-publishing-studio -ORIXTemplate technical-manual -ORIXMode publishing -ORIXSidebar pages -ORIXInspector publish -ORIXZoom 0.7 -ORIXPage 382shot 13-local-ai -ORIXTemplate research-report -ORIXMode writing -ORIXInspector intelligence -ORIXDemo select -ORIXIntelligenceAction rewrite -ORIXHideSidebar YES -ORIXSnapshotDelay 4083shot 14-document-auditor -ORIXTemplate thesis -ORIXMode writing -ORIXInspector audit -ORIXAudit YES -ORIXSidebar outline -ORIXSnapshotDelay 684shot 15-light-mode -ORIXTemplate newsletter -ORIXMode writing -ORIXSidebar pages -ORIXInspector styles -ORIXAppearance light85shot 16-dark-mode -ORIXTemplate newsletter -ORIXMode writing -ORIXSidebar pages -ORIXInspector styles -ORIXAppearance dark86shot 17-focus-mode -ORIXTemplate book-manuscript -ORIXMode focus -ORIXPage 5 -ORIXDemo end87shot 18-export-sheet -ORIXTemplate research-report -ORIXSheet export -ORIXDemo review -ORIXSnapshotDelay 388shot 19-automation -ORIXTemplate research-report -ORIXSheet automation -ORIXSnapshotDelay 389shot 20-styles -ORIXTemplate technical-manual -ORIXMode writing -ORIXInspector styles -ORIXSidebar outline -ORIXPage 69091# The French interface (fr-CA), same scenario as the review screenshot.92if [[ ${#ONLY[@]} -eq 0 || " ${ONLY[*]} " =~ " 21-french-interface " ]]; then93 rm -f "$OUT/21-french-interface.png"94 "$APP" -ApplePersistenceIgnoreState YES -AppleLanguages "(fr-CA)" -AppleLocale fr_CA -defaultLanguage fr -defaultPaper "US Letter" -reviewerName "Camille Roy" -checkSpelling NO \95 -ORIXWidth 1440 -ORIXHeight 900 -ORIXTemplate research-report -ORIXMode review -ORIXSidebar review -ORIXInspector document -ORIXDemo review -ORIXSnapshot "$OUT/21-french-interface.png" >/dev/null 2>&1 & pid=$!96 for _ in $(seq 1 40); do kill -0 $pid 2>/dev/null || break; sleep 1; done; kill -9 $pid 2>/dev/null97 [[ -f "$OUT/21-french-interface.png" ]] && echo "ok 21-french-interface" || echo "FAIL 21-french-interface"98fi99100# Template chooser and comparison window are separate windows with their own capture hooks.101if [[ ${#ONLY[@]} -eq 0 || " ${ONLY[*]} " =~ " 00-template-chooser " ]]; then102 rm -f "$OUT/00-template-chooser.png"103 "$APP" "${BASE[@]}" -ORIXChooserSnapshot "$OUT/00-template-chooser.png" -ORIXSnapshotDelay 9 >/dev/null 2>&1 & pid=$!104 for _ in $(seq 1 40); do kill -0 $pid 2>/dev/null || break; sleep 1; done; kill -9 $pid 2>/dev/null105 [[ -f "$OUT/00-template-chooser.png" ]] && echo "ok 00-template-chooser" || echo "FAIL 00-template-chooser"106fi107if [[ ${#ONLY[@]} -eq 0 || " ${ONLY[*]} " =~ " 11-document-comparison " ]]; then108 rm -f "$OUT/11-document-comparison.png"109 "$APP" "${BASE[@]}" -ORIXOpen "$PWD/build/shots/revised.md" -ORIXSheet compare -ORIXCompareWith "$PWD/build/shots/original.md" -ORIXCompareSnapshot "$OUT/11-document-comparison.png" >/dev/null 2>&1 & pid=$!110 for _ in $(seq 1 40); do kill -0 $pid 2>/dev/null || break; sleep 1; done; kill -9 $pid 2>/dev/null111 [[ -f "$OUT/11-document-comparison.png" ]] && echo "ok 11-document-comparison" || echo "FAIL 11-document-comparison"112fi113