🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #1185

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

#1185
From: Skempy
Date: Thu, 19 Feb 2009 08:04
21 lines
1055 bytes
Dave,

This works:

var myPreflight = app.preflightProcesses[0];
  var myReport = myPreflight.processResults;
  var myTest = myReport.indexOf("None");
  if (myTest == 0)
	{
	alert ("No errors found");
	}
  else
	{
	alert ("Errors found");
	}

If there are no preflight errors then myTest returns "0", if there are any preflight errors found then myTest returns "-1".

Thank you for your time and for pointing me in the right direction.

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

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,d713958badc61099
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!news2.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: [JS CS4] Why is this If Else test not working?
Message-ID: <59b7f983.6@webcrossing.la2eafNXanI>
Date: Thu, 19 Feb 2009 00:04:38 -0800
References: <59b7f983.-1@webcrossing.la2eafNXanI>
Lines: 22
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit