Preparation of indoline derivative and their use as photoactive compounds