Tell non-existing app

It occurs to me I didn’t understand your question properly. A way to not attempt a “tell keychain” would be to store the script as two files. The first checks if keychain is in the control panels folder, and if it is, loads then runs the script with the keychain tell block.