Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

EventMonitor.SetCardWindow

Sets script trigger for clicks outside card.

Component Version macOS Windows Linux Server iOS SDK
EventMonitor 7.3 ✅ Yes ✅ Yes ❌ No ❌ No ❌ No
MBS( "EventMonitor.SetCardWindow"; WindowRef; X; Y; Width; Height; FileName; ScriptName { ; ScriptParameter; ScriptControl } )   More

Parameters

Parameter Description Example Flags
WindowRef Window Reference is the unique OS level window ID. You can obtain this by using the Window.FindByTitle or Window.FindByIndex functions. Pass zero to access the frontmost window. 0
X X position of the card in the parent window.
Can be negative for automatic center position.
-1
Y Y position of the card in the parent window.
Can be negative for automatic center position.
You may need to include space for formating, status toolbar and menu bar (inside window on Windows).
-1
Width The width of the card window. 600
Height The height of the card window. 400
FileName The file name where to find the script. Get(FileName)
ScriptName The name of the script to trigger when a click is received outside the card area. "Close Card Script"
ScriptParameter Available in MBS FileMaker Plugin 9.3 or newer.
The text parameter to pass to the script.
"Close" Optional
ScriptControl Available in MBS FileMaker Plugin 9.3 or newer.
The script control mode.
Can be Pause, Halt, Exit or Resume.
Default is Pause.
"pause" Optional

Result

Returns OK or error.

Description

Sets script trigger for clicks outside card.
You can show a card and have the MBS Plugin watch for mouse clicks outside the card area. The plugin can trigger a script. As script triggers are queued up, please make sure you handle various cases like several clicks queue up.

Please call EventMonitor.Install once before and make sure it’s enabled.

Since we lookup the window size for the card, please don't name your window and the card window the same.


With plugin version 6.0 or newer the script name can be a script ID number. In that case the plugin queries the script name for the given script ID. This allows to call scripts by ID and avoid problems if scripts are later renamed.

Notice: FileMaker 19.2 adds a fmplugin extended privileges. If you have such an extended privileges to allow the plugin to trigger scripts, you need to grant permissions for it. If such a privilege is not defined, the plugin is allowed to trigger scripts. See FileMaker product documentation for details.

Examples

Install trigger:

Set Variable [ $r ; Value: MBS( "EventMonitor.Install" ) ]
Set Variable [ $$cardShowing ; Value: 1 ]
Set Variable [ $r ; Value: MBS( "EventMonitor.SetCardWindow"; Get(WindowName); -1; -1; 600; 400; Get(FileName); "Close Script" ) ]
New Window [ Style: Card ; Name: "Card" ; Using layout: “Tabelle” ; Height: 400 ; Width: 600 ]

Close script:

If [ $$cardShowing ]
    Set Variable [ $$cardShowing ; Value: 0 ]
    Close Window [ Name: "Card" ; Current file ]
    Set Variable [ $r ; Value: MBS("EventMonitor.ClearCardWindow") ]
End If

See also

Release notes

Example Databases

Blog Entries

This function checks for a license.

Created 2nd June 2017, last changed 29th February 2024


EventMonitor.LastMousePositionY - EventMonitor.SetEnabled