Is it possible to send a script to a camera through USB and tell it to execute?
Sure, using CHDK or an unofficial version of SDM.
With SDM, you type the following on your PC :
sdmcon --sdm
Then after the <conn> prompts :-
<conn>record
<conn>shoot
That captures an image and stores it in a folder on your PC
This will not be supported in the official SDM 1.86 release.
If you want to try it, send me a personal message stating camera and firmware version and a suitable email contact address.
David