I want to know if this is possible, to launch a ur program that takes pictures and passed a msg on the computer when the picture is taken.
Then when the computer finished to analyze the pictures, it communicate a data to the ur5e and depending on the data receive the ur5e choose between action a and action b.
You are probably better off controlling the camera via your PC. You can have the robot execute a remote command to trigger the camera, read and process the data, and then send back a response. One of the ways to do that is via XML-RPC which you can find more information about here: https://www.universal-robots.com/articles/ur/interface-communication/xml-rpc-communication/
I would also recommend reading through the first couple chapters of that manual as it has important information about how the language works with the robot/controller.