Thread View: adobe.scripting.indesign
11 messages
11 total messages
Started by thailu
Thu, 22 Jan 2009 07:58
Execute spell checking Before close document using javascript...
Author: thailu
Date: Thu, 22 Jan 2009 07:58
Date: Thu, 22 Jan 2009 07:58
4 lines
881 bytes
881 bytes
Hi Everyone!
Actually i'm working in Indesign cs2 platform. i need one help to all that's lot of time i forget spell check before close the indesign doc. any one tell before closing Doc the script execute to check spelling and solve the problem.(depending upon the dictionary language) Thanks in Advance.
-yajiv
Re: Execute spell checking Before close document using javascript...
Author: Kasyan Servetsky
Date: Thu, 22 Jan 2009 08:25
Date: Thu, 22 Jan 2009 08:25
39 lines
2007 bytes
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");
}
Re: Execute spell checking Before close document using javascript...
Author: thailu
Date: Thu, 22 Jan 2009 10:46
Date: Thu, 22 Jan 2009 10:46
8 lines
835 bytes
835 bytes
Thanks Kasyan .. But some Error occurs below.. Can you slove the error..? Thanks in Advance Cannot handle the request bcoz a modal or alert is active. Line 22: Source : app.menuaction.item(๏ฟฝCheck Spelling..๏ฟฝ).invoke();
Re: Execute spell checking Before close document using javascript...
Author: thailu
Date: Thu, 22 Jan 2009 10:56
Date: Thu, 22 Jan 2009 10:56
1 lines
736 bytes
736 bytes
As well as can you tell working with CS2 is possible or not. if possible can you wrote down code please.. Thanks in Advance..
Re: Execute spell checking Before close document using javascript...
Author: Kasyan_Servetsky
Date: Thu, 22 Jan 2009 14:05
Date: Thu, 22 Jan 2009 14:05
2 lines
787 bytes
787 bytes
This script is for CS3 – it uses features that are not available in CS2. For that reason, I think it's impossible to make such a script for CS2.
Re: Execute spell checking Before close document using javascript...
Author: thailu
Date: Thu, 22 Jan 2009 14:07
Date: Thu, 22 Jan 2009 14:07
2 lines
751 bytes
751 bytes
Thanks Kasyan Servetsky.. actually i ask one error can you solve that problem or tell me what's the error. Thanks in advance
Re: Execute spell checking Before close document using javascript...
Author: Kasyan_Servetsky
Date: Thu, 22 Jan 2009 14:17
Date: Thu, 22 Jan 2009 14:17
1 lines
832 bytes
832 bytes
I surmise that you are trying to use this script in ID CS2, which doesn’t support menuAction’s ‘invoke()’ invoke method – that’s why this line causes the error.
Re: Execute spell checking Before close document using javascript...
Author: thailu
Date: Thu, 22 Jan 2009 14:22
Date: Thu, 22 Jan 2009 14:22
4 lines
767 bytes
767 bytes
no Kasyan Servetsky.. I use Indesign CS3 that's y i ask question(i'm not using CS2). or how retify the problem. Thanks in advance. -yajiv
Re: Execute spell checking Before close document using javascript...
Author: Kasyan_Servetsky
Date: Thu, 22 Jan 2009 15:05
Date: Thu, 22 Jan 2009 15:05
1 lines
736 bytes
736 bytes
I tested the script again — it works for me. I'm on Mac OS X 10.4.11, ID 5.0.4
Re: Execute spell checking Before close document using javascript...
Author: thailu
Date: Thu, 22 Jan 2009 15:27
Date: Thu, 22 Jan 2009 15:27
4 lines
773 bytes
773 bytes
Thanks i checked ovce again and let you inform. thank you very much its really uesful to me. thank god. -yajiv
Re: Execute spell checking Before close document using javascript...
Author: Harbs
Date: Thu, 22 Jan 2009 23:48
Date: Thu, 22 Jan 2009 23:48
10 lines
821 bytes
821 bytes
> thank god. > Kasyan, sounds like you've been promoted! ;) -- Harbs http://www.in-tools.com
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads