I saw that there was no solution to this in early 2021 (Is there a way to check if a script is run from a button field or the script app itself?). How about now?
Solved
Running a script from a button vs app in 2022

Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.