Your screenshot is showing that you are currently running Script Editor and are trying to open the Photos application in script Editor. There may be a misunderstanding, how to use Apple Scripts. ScriptEditor can open Apple Scripts, not other applications.
For example, If you want to run the script described here: Script: Batch Changing the Titles to the Filename w/Extension ,
- open the Photos.app by clicking the icon in the Dock,
- then select the photos where you want to change the titles,
- launch Script Editor and select to create a new script,
- then copy and paste the code of the script into an open Script Editor window and click the Run button in Script Editor.
The script will run and tell the Photos application to change the titles of the selected photos to the filenames.
Test it on a new Photos Library, not on your main library, before you try it on your main library. And make a current backup of your Photos Library, before try to run scripts soon the library.