🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #1964

Re: Execute spell checking Before close document using javascript...

#1964
From: Kasyan Servetsky
Date: Thu, 22 Jan 2009 08:25
39 lines
2007 bytes
Hi yajiv,

This is for CS3, but I hope you can use it as starting point for your script.

Kasyan




 
/* CheckSpelling.jsx
Version 1
This script is written to remind a user to spell-check the current document.
Put this script into Startup scripts folder and restart InDesign if it's running. */
#target indesign
#targetengine "session"
var myLastDoc;
var myConfirm;
var myCheckSpellEvList = app.menuActions.item("Check Spelling...").addEventListener("beforeInvoke", myCheckSpellHandler, false);
var myBeforeCloseEvList = app.addEventListener("beforeClose", myBeforeCloseHandler, false);
var myAfterCloseEvList = app.addEventListener("afterClose", myAfterCloseHandler, false);
function myBeforeCloseHandler(myEvent){
   myConfirm = false;
   if (!eval(myEvent.parent.extractLabel("SpellingChecked")) && myEvent.parent.saved == true){
      myLastDoc = myEvent.parent.fullName;
      myConfirm = confirm("Do you want to check spelling now?", false, "You forgot to check spelling!");
   }
}
function myAfterCloseHandler(myEvent){
   if (!eval(myEvent.parent.extractLabel("SpellingChecked"))){
      if (myConfirm) {
         app.open(myLastDoc);
         app.menuActions.item("Check Spelling...").invoke();
      }
   }
}
function myCheckSpellHandler(myEvent){
   app.activeDocument.insertLabel("SpellingChecked", "true");
}
Technical Details
Message-ID: <59b794dc.0@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
References: <59b794dc.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,31892d7a2c8a8bd0
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Kasyan Servetsky" <askoldich@yahoo.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: Execute spell checking Before close
 document using javascript...
Message-ID: <59b794dc.0@webcrossing.la2eafNXanI>
Date: Thu, 22 Jan 2009 00:25:15 -0800
References: <59b794dc.-1@webcrossing.la2eafNXanI>
Lines: 31
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit