Article View: adobe.photoshop.scripting
Article #189Re: Programatically delete Photoshop Temp##### files
From: xbytor
Date: Mon, 09 Mar 2009 23:08
Date: Mon, 09 Mar 2009 23:08
24 lines
1891 bytes
1891 bytes
Photoshop has not always done a good job with cleaning up these temp files,
especially if PS crashes (which is not an uncommon for me).
The simplest thing is to try do delete all of them when PS starts up. The
remove() call will fail for the current temp file(s), but you do have to know
where they're located to do the getFiles() call.
And if you want to shutdown, photoshop at the end of your script, do this:
photoshop.quit();
For a more elaborate solution, you could send bit of script to Bridge to
shutdown PS, remove all of the temp files and restart PS. I've written several
fault-tolerant scripts that would restart PS multiple times when processing
thousands of images over the course 12-48 hours, so this technique does work.
> If I (user "A") am bumped out due to an application crash and someone else (user "B") logs in will it still delete the scratch file upon Photoshop launch?
From what I have seen in the past, the temp files are deleted as a part of
normal PS shutdown, not during startup. I've had several temp files of different
ages laying around long after they were needed.
-X
Technical Details
Message-ID:
<FD07049835C608FAD6188404FA3EEA10@in.webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed.news2me.com!newshub.sdsu.edu!webcrossingReferences:
<59b82656.-1@webcrossing.la2eafNXanI> <59b82656.2@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f5839,1b7252e985494225 X-Google-Attributes: gidf5839,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: xbytor@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed.news2me.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.photoshop.scripting Subject: Re: Programatically delete Photoshop Temp##### files Message-ID: <FD07049835C608FAD6188404FA3EEA10@in.webcrossing.la2eafNXanI> Date: Mon, 9 Mar 2009 16:08:15 -0700 References: <59b82656.-1@webcrossing.la2eafNXanI> <59b82656.2@webcrossing.la2eafNXanI> Lines: 36 User-Agent: Thunderbird 2.0.0.19 (Macintosh/20081209) MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit