Weird sporadic applescript droplet photoshop cs4 problem

Dragging jpgs onto a applescript droplet that runs perfectly about 80% of the time

Opens photoshop cs4 & processes as I expect, but 20% of the time Photoshop CS4 activates & I get this error dialog.

"Can’t get <> of application “Adobe Photoshop CS4”

Does anyone have experience on how I can avoid this… as the script then stops & nothing is processed.

The jpegs are of the exactly same type & dragged from the same folder everytime.

It seems to happen also if I drag the jpegs onto the droplet & the jpegs are in some other view then list.

List view works about 80% of the time.

Have you done any troubleshooting to figure out which line is causing that error? If you can isolate that, post that line of code. Otherwise, you should probably post your whole script. Without any code, it’s hard to offer any help.