tags:

views:

453

answers:

2

How do I close photoshop using its javascript scripting language.

(I am automaticly scripting a great deal of things, and I notice that for one reason or another, some of the ram is not releasing with each new task. My hopes are that after X ammount of operations, I will fully close photoshop, to free up the ram.. which it is eating up all of my 8 gigs, and after which then opens photoshop help and causes a huge failure (actually, to be honest it fills up my hard drive with junk till I get a "hard drive is full" message... (I think it is dumping the ram into virtual ram on my hard drive?)... what a mess)

THANKS!!

A: 

Photoshop uses a file on disk for temporary storage, so that it doesn't have to keep everything in memory. This file is by default created on the startup drive, but as you seem to have too little free space on that drive you should change the settings so that it creates the file on a disk with more free space.

Guffa
A: 

Hi,

I've looked into the Photoshop JSX DOM a bit and couldn't find any magic function to delete temporary files.

The closest thing to your needs was purging caches:

app.purge(PurgeTarget.ALLCACHES);

but that doesn't help much. I tried to find a way to call a .bat file from JSX, but couldn't find anything yet, also, you are unable to delete Photoshop temporary files from the system if you have Photoshop running, event though all documents might be closed.

Put this in a bat file to clear your temp folder. it might help you save a few seconds, but I don't think I can help much.

cd %homepath%\Local Settings\Temp
del * /f /s /q /a r h

If you can automate the process of generating a psd, closing photoshop, clearing temp and repeating for next, that's great. If not, borrow an external hdd from a friend or buy one and set photoshop's scrath disk to that. It might save you a lot more time and headaches than trying to get around it. Photoshop may eat a of resources, but if it gets the job done, 'pay the tribute' and get it done fast. On the long run it will pay off.

George Profenza