Article View: adobe.photoshop.scripting
Article #514Re: determine if file has never been saved in javascript
From: Michael_L_Hale
Date: Sun, 04 Jan 2009 15:34
Date: Sun, 04 Jan 2009 15:34
17 lines
1057 bytes
1057 bytes
If I understand your question fully. I would do something like this:
// check doc status
if( ! activeDocument.saved ) {
if(isDocumentNew()){// X's function
//sample code to handle a new doc
var f = new File('/c/temp/temp.psd');
activeDocument.saveAs(f);
}else{
//sample code to handle a changed doc
activeDocument.save();
}
}
// now saple code to handle all doc as saved
activeDocument.close();
Mike
Technical Details
Message-ID:
<59b76a8b.5@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!news2!newshub.sdsu.edu!webcrossingReferences:
<59b76a8b.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f5839,c148bdfc9cff5bad X-Google-Attributes: gidf5839,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Michael_L_Hale@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!news2!newshub.sdsu.edu!webcrossing Newsgroups: adobe.photoshop.scripting Subject: Re: determine if file has never been saved in javascript Message-ID: <59b76a8b.5@webcrossing.la2eafNXanI> Date: Sun, 4 Jan 2009 07:34:30 -0800 References: <59b76a8b.-1@webcrossing.la2eafNXanI> Lines: 17 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit