Findin if file exists (without triggering prompt bos)

I’ve been using the cocoa code in this post successfully for some time now.
I call set applicationPath to (call method “getAppPathFromBundleID:” of class “methods” with parameter “org.videolan.vlc”) on startup of my script and it works like a charm.
Today however, I discovered that if the application that is missing, I get this dialog:

This annoying dialog comes from somewhere but it’s not my doing. I guess it has someting to do with the coccoa code, of which I understand very little.

Even more interesting is that you don’t get this dialog of you try a finding a nonsence bundle ID like “org.abcdefg.hijc”, instead the coccoa code then returns an empty path which is exactly what I want if the real application searched for is missing.

Does anyone have a clue how to get rid of this annoyence of a dialog. If the application isn’t found, I just want the returnpath to be empty…