Article View: adobe.photoshop.scripting
Article #144Re: Scripting novice needs help!
From: fazstp
Date: Mon, 16 Mar 2009 05:47
Date: Mon, 16 Mar 2009 05:47
31 lines
1169 bytes
1169 bytes
Can you just suppress dialogs and use a try block to open the image?
function openImage( file_name ) {
// store dialog mode
dialog_mode = displayDialogs;
displayDialogs = DialogModes.NO;
// init flag
var file_valid = true;
// get file ref
var file_ref = File( file_name );
// try to open image
try {
// open file
open ( file_ref );
} catch( err ) {
// clear flag
file_valid = false;
}
// restore dialog mode
displayDialogs = dialog_mode;
// return success
return file_valid;
}
Technical Details
Message-ID:
<59b81b1c.2@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!news2.glorb.com!newshub.sdsu.edu!webcrossingReferences:
<59b81b1c.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f5839,e2b6b032f624e614 X-Google-Attributes: gidf5839,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: fazstp@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!news2.glorb.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.photoshop.scripting Subject: Re: Scripting novice needs help! Message-ID: <59b81b1c.2@webcrossing.la2eafNXanI> Date: Sun, 15 Mar 2009 22:47:53 -0700 References: <59b81b1c.-1@webcrossing.la2eafNXanI> Lines: 31 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit