🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #1164

[JS CS4] Why is this If Else test not working?

#1164
From: Skempy
Date: Wed, 18 Feb 2009 16:09
22 lines
1097 bytes
The following script pops up an alert showing me the results of a live Preflight running in a document.

var myPreflight = app.preflightProcesses[0];
   var myReport = myPreflight.processResults;
   alert(myReport);

If there are no errors then the alert says "None".

My test below doesn't work and gives the "Errors found" alert even if there are no Preflight errors in the document.

if (myReport == "None")
	{
	alert ("No errors found");
	}
else
	{
	alert ("Errors found");
	}

Can anyone explain where I am going wrong.

Thanks
Technical Details
Message-ID: <59b7f983.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,d713958badc61099,start
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Skempy@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: [JS CS4] Why is this If Else test not working?
Message-ID: <59b7f983.-1@webcrossing.la2eafNXanI>
Date: Wed, 18 Feb 2009 08:09:18 -0800
Lines: 24
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit