Maybe with a custom dialogue box too?
If [ get( foundcount) =0 ]
Exit Script [ ]
Or to exit a script if found set is not empty?
if get ( foundCount) = 0
// do stuff if no records found
// do stuff if records found
This but also remember to do Set Error Capture [ On ] before any Perform Find (or similar) action to suppress the default FileMaker dialog.
Retrieving data ...