Skip to content

Instantly share code, notes, and snippets.

@petrowsky
Last active August 8, 2024 21:38
Show Gist options
  • Save petrowsky/f85fdc549e72ca297c92e64e53a0aaf9 to your computer and use it in GitHub Desktop.
Save petrowsky/f85fdc549e72ca297c92e64e53a0aaf9 to your computer and use it in GitHub Desktop.
AppleScript for triggering the Specify dialog.
-- Version 240808-02
try
--tell application "FileMaker Pro" to activate
tell application "System Events"
tell process "FileMaker Pro"
set theWindow to window 1
set uiElements to entire contents of theWindow
if (name of window 1 is "Specify Calculation") then
click button 5 of window "Specify Calculation"
return
else
if (count of uiElements) is greater than 200 then return false
-- Loop through the UI elements to find the button named "Specify…"
repeat with anElement in uiElements
if class of anElement is button and name of anElement is "Specify…" then
-- If found, perform an action (e.g., click the button)
click anElement
exit repeat
end if
end repeat
end if
-- These are buttons within the Specify Calculation dialog
-- Help button with ? icon
--click button 2 of window "Specify Calculation"
-- These are the same thing for "OK"
--click button 3 of window "Specify Calculation"
--click button "OK" of window "Specify Calculation"
-- This zooms the window (green + button)
--click button 5 of window "Specify Calculation"
end tell
end tell
on error
-- Handle the error (e.g., by doing nothing or showing a message)
end try
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment