A search of the forum for ExternalObject should find you plenty of reference…?
You just need to load library…
Retrieve your value…
Do your Photoshop process ( use switch or if/else )
Unload the library
Done…
If you struggle post back I may be able to help…