How to force script to execute in the background?

Okay, thank you all for your help with my other problems so far. Here is my last question for today:

I have a script that opens image files in Photoshop and creates thumbnails. If I do batch processing without a script, I can switch to a different program and the image processing continues in the background - this way I can use my computer while the batch processing is running, and it is also much faster, because, I guess, there is no rendering of large image files for the screen. But when I process the images by dragging a folder full of images on my script, the script brings Photoshop to the foreground each time it opens a new image, even if I switch to a different program - Photoshop simply comes to the front again. This makes the computer unusable for me during image processing, and it is much slower.

So, how can I force the script (or Photoshop) to work in the background? Or can I maybe even force them to work invisibly, like file renaming, which I don’t see at all, if I don’t open the image folder and look a the file names while they are being changed?

Maybe it could be suffcient to delete a present “activate” line

Yes! Thank you! The images are still rendered in the background behind the active program window, so it is not quick like the flat grey dummies that Photoshop batch processing shows, but at least I can write some emails or scratch my head over some piece of code while the images are being processed.

Here is an option that I use you may like this. If your script is the batch choose folder style then add line “delay 10” before the repeat loop for photoshop. With this I can run Photoshop processing in second user account. The delay gives me the time to use fast user switching between accounts. How much you other programs are affected by this is down to your ram and processor. It would be nice if someone knows if a “Finished” dialog could be past from script in one account to another.