Incorrect validation loop [duplicate]

Rather than guess at what AppleScript is doing, have you considered running it in a debugger to know the variables as it runs and errors out?

  • https://latenightsw.com/

Some things that make it hard to make a better answer are the parts where you say:

The main took with past issues on this site on this topic.

And

but apparently the wrong condition, apparently the wrong data types

And mostly

Some will insert, some will not, regardless of the initial condition. What could be the reason? Where is the error? And is it possible to make it so that after a certain number of verified numbers, he himself deleted open dialogs with these numbers?

Since you don’t post input values or share output values were really guessing even more than you. I would get into the debugger so you can see the flow.