You can use Get ( WindowMode ) to check and see if you are currently in find mode.
It can be useful to have scripts perform in find mode as well as in browse mode.
Few of my database solutions would correctly function if this were not possibile as I routinely use scripted finds where the script enters find mode, specifies criteria with set field steps and then performs a find.
Right, I absolutely get your point. I have a bunch of those scripts too.
I'd just prefer that buttons not function like buttons in find mode. There's no situation where I'd put users into find mode and leave them there, so there'd be no need for UI elements like a clickable script.
I do, however, routinely pop into find mode myself to perform some ad-hoc search, and in that context, I don't want to execute scripts normally involving data entry.
Does that make sense? I might not be phrasing this as clearly as possible.
Yes, but in Filemaker, it's the same issue. And other developers do enter find mode and pause, relying on buttons in the interface to then perform the find and also to manipulate the criteria being entered into the layout. That's not my preferred approach either, I prefer to capture find criteria in global fields, but other users do use this method.
And you can keep a script from executing when in find mode with this If block:
If [ Get ( windowMode ) ≠ 1 ]
Put your script here
That makes sense, I reckon; it just never occurred to me anyone would want to do that. I'll just use the get(windowmode) method.