Skip to content

iMessage previews, caption hints, double-click .command launchers#3

Open
johansolve wants to merge 8 commits into
fltman:mainfrom
johansolve:dotcommand-launchers
Open

iMessage previews, caption hints, double-click .command launchers#3
johansolve wants to merge 8 commits into
fltman:mainfrom
johansolve:dotcommand-launchers

Conversation

@johansolve

@johansolve johansolve commented Apr 28, 2026

Copy link
Copy Markdown

Three independent quality-of-life improvements to gemma-photos and the install flow.

iMessage / IPmi previews

Photos shared via iMessage live in the library with AppleScript class «IPmi» instead of media item. Two failure modes I hit:

  • id of p raises -1700 — the id property can't be coerced to text the normal way
  • Photos refuses to export them as media item id "…" references (-1728)

Fix: the AppleScript coercion error message dumps the whole selection list literally with every item's id inline, so we extract the i-th id from that. Once we have the uuid, osxphotos finds the on-disk preview under Photos Library/scopes/syndication/resources/derivatives/ and we hand that to Gemma — no Photos export needed.

When an item genuinely has no derivative on disk (iCloud-only with derivative purged), per-item AppleScript export with a try-wrapper handles it; IPmi items that can't be exported drop out silently without taking the rest of the batch with them.

Existing caption as a hint

By default the photo's current description is fed to the model as a soft hint. Useful when a human got a detail right that the vision model gets wrong — e.g. a BMW the model kept insisting was a Volvo. --replace-caption opts out for a clean re-pass.

Double-click .command launchers

install.sh / uninstall.sh renamed to .command — Finder runs them in Terminal on double-click, and they're indistinguishable from .sh when invoked from a shell. Single extension covers both entry points.

Adds gemma-photos.command and gemma-yearbook.command at repo root: thin wrappers around bin/gemma-photos and bin/gemma-yearbook that resolve the repo path from $BASH_SOURCE, so they work regardless of where the repo lives.

README updated to lead with the double-click flow and document --replace-caption + the IPmi preview path.

johansolve and others added 8 commits April 28, 2026 07:46
Photos refuses to coerce `id of p` for IPmi class items and rejects
exporting them via `media item id "..."` references. We extract the
uuid from AppleScript's coercion error message (which dumps the whole
selection list literally) and look up the preview derivative via
osxphotos — IPmi items live under `scopes/syndication/resources/
derivatives/` and load fine that way.

Per-item export with try-wrapper as fallback: lets normal items export
even when an IPmi item is in the selection, instead of failing the
whole batch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Default behaviour: read the photo's current description from osxphotos
and feed it to Gemma as guidance — useful when the model otherwise
mis-identifies details a human got right (e.g. specific car brands).

Opt out with --replace-caption when you want a fresh analysis.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…mand

Finder runs .command files in Terminal on double-click, and they're
indistinguishable from .sh scripts when invoked from a shell. Single
extension covers both entry points.

Adds gemma-photos.command and gemma-yearbook.command at repo root —
thin wrappers around bin/gemma-photos and bin/gemma-yearbook that
resolve the repo path from \$BASH_SOURCE so they work regardless of
where the repo lives.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts:
#	photos_caption.py
…ion + IPmi

Surface Finder double-click as the primary install/run path now that
.command launchers exist for the installer, photos and yearbook.
Mention --replace-caption and the IPmi/iMessage preview path picked up
in the recent merges.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@johansolve johansolve changed the title launchers: rename install/uninstall .sh → .command, add per-tool .command iMessage previews, caption hints, double-click .command launchers Apr 28, 2026
@johansolve

Copy link
Copy Markdown
Author

Heads-up: this PR ended up bundling three independent feature branches by accident — photos-ipmi-preview, photos-caption-hint and dotcommand-launchers were all merged into main locally, then a subsequent git merge origin/main pulled the whole lot into this branch's history. The original intent was a launcher-only PR.

The three features are functionally independent and could be split into separate PRs if you'd prefer to review them apart — happy to reset and re-open as three. Otherwise the commits are still individually reviewable in the Commits tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant