Skip to content

Improve script deployment targeting reliability#37

Open
kirkabowman wants to merge 1 commit into
petrowsky:mainfrom
kirkabowman:fix/deploy-targeting
Open

Improve script deployment targeting reliability#37
kirkabowman wants to merge 1 commit into
petrowsky:mainfrom
kirkabowman:fix/deploy-targeting

Conversation

@kirkabowman
Copy link
Copy Markdown

Summary

Three related fixes to make script deployment hit the intended target reliably:

  • deploy.py — add a hidden-window fallback (Window → Show Window submenu) so files that aren't currently visible get unhidden before paste. Switch to exact-name matching (name is "File.fmp12" or name is "File") instead of name contains, which was matching A2X_General against both A2X_General and A2X_General_data. Replace keystroke-based Select All / Paste with menu actions to avoid triggering OnLayoutKeystroke triggers on the active FM layout during deployment.
  • filemaker/agentic-fm.xml — call MBS("ScriptWorkspace.ExpandScriptFolders") three times before opening the target script, so scripts inside nested folder groups are reachable by OpenScript.
  • agent/scripts/companion_server.py — same exact-name match treatment for /trigger's document selection AppleScript, preventing the same prefix-collision class of bug.

Test plan

  • Open two FM files with prefix-overlapping names (e.g. A2X_General and A2X_General_data); deploy a script targeting A2X_General and confirm it lands in the right file
  • Hide a file via Window → Hide Window, then deploy to it; confirm it's unhidden and the script pastes
  • Set up an OnLayoutKeystroke trigger on the active layout that logs/alerts; deploy a script and confirm the trigger does NOT fire
  • Deploy a script that lives inside a nested script folder; confirm OpenScript reaches it after the ExpandScriptFolders calls

🤖 Generated with Claude Code

- deploy.py: add hidden-window fallback so target files in Window > Show
  Window submenu are unhidden before paste; use exact-name matching
  ("File.fmp12" or "File") to avoid prefix collisions; switch from
  keystrokes to menu actions for Select All / Paste so OnLayoutKeystroke
  triggers on the active layout do not fire during deployment.
- filemaker/agentic-fm.xml: call MBS ScriptWorkspace.ExpandScriptFolders
  three times before opening the target script so nested folder scripts
  are reachable.
- companion_server.py: tighten /trigger document targeting to exact name
  match instead of "name contains" — prevents A2X_General matching
  A2X_General_data when both are open.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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