[object Object]

← back to Dw Chat Analyzer

Chat watcher: alert activates FileMaker then pops the dialog ON it (AppleScript, guarded) — FileMaker-screen alert fully automated, no script paste needed

671da21a4e585d7ef29b9219434340eebb41d320 · 2026-08-11 08:41:51 -0700 · steve

Files touched

Diff

commit 671da21a4e585d7ef29b9219434340eebb41d320
Author: steve <steve@designerwallcoverings.com>
Date:   Tue Aug 11 08:41:51 2026 -0700

    Chat watcher: alert activates FileMaker then pops the dialog ON it (AppleScript, guarded) — FileMaker-screen alert fully automated, no script paste needed
---
 watch.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/watch.js b/watch.js
index 16a255a..3ae5ca1 100644
--- a/watch.js
+++ b/watch.js
@@ -59,7 +59,10 @@ function macNotify(title, subtitle, msg, url) {
   const esc = s => String(s || '').replace(/["\\]/g, '\\$&').replace(/[\r\n]+/g, ' ');
   const scpt = (process.env.NOTIFY === 'banner')
     ? `display notification "${esc(msg)}" with title "${esc(title)}" subtitle "${esc(subtitle)}" sound name "Glass"`
-    : `set r to display dialog "${esc(subtitle)}\n${esc(msg)}" with title "${esc(title)}" buttons {"Dismiss","Open chat"} default button "Open chat" with icon note giving up after 120
+    : `tell application "System Events" to set fmUp to exists process "FileMaker Pro"
+       if fmUp then tell application "FileMaker Pro" to activate
+       delay 0.2
+       set r to display dialog "${esc(subtitle)}\n${esc(msg)}" with title "${esc(title)}" buttons {"Dismiss","Open chat"} default button "Open chat" with icon note giving up after 90
        if button returned of r is "Open chat" then open location "${esc(url)}"`;
   try { require('child_process').spawn('osascript', ['-e', scpt], { detached: true, stdio: 'ignore' }).unref(); } catch {}
 }

← 6485514 Chat watcher: clickable 'Open chat' dialog (opens Zendesk on  ·  back to Dw Chat Analyzer  ·  auto-data-snapshot: 2026-08-12T08:23:24 (1 data files) — .wa 0a7fdd9 →