Article View: adobe.scripting.indesign
Article #2149JS CS4 Wait for menu item to close
From: ABC_GREEN
Date: Fri, 09 Jan 2009 01:27
Date: Fri, 09 Jan 2009 01:27
35 lines
1762 bytes
1762 bytes
I am trying to open a dialog in indesign and continue my work after dialog was closed
in vbs my code looks like this and works perfectly
myMenu.invoke [opens Indesign Dialog]
On error resume next
do
err.clear
myIndesign.myFunction(variable1,variable2)
loop while err.Number <> 0 [error while dialog is open andexicutes when dialog closes]
On error Goto 0
in js my codelooks like this
myMenu.invoke [opens Indesign Dialog]
var noError = false;
do{
noError = false;
try{
app.myFunction(variable1,variable2);
}catch(err){
noError = true;
}while(noError==false)
it would work but indesign dialog is not editable.
it seems that vbs runs on seperate thread while js runs on indesigns thread.
I tried addin sleep time into loop but it didn't help.
my js uses its own #engine, if that makes a differance. Would it help if #engine used to invoke menu item was not mine? and would that be possible to maybe call a different js file which has its own engine.
I need it for mac compatability. maybe applescript would solve my problem but I cant figure out how to loop and how to call function with to integer parameters
Thank for any and all help.
ABC GREEN
Technical Details
Message-ID:
<59b7773f.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: f939a,828dfc03f1d6f13f,start X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: ABC_GREEN@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: JS CS4 Wait for menu item to close Message-ID: <59b7773f.-1@webcrossing.la2eafNXanI> Date: Thu, 8 Jan 2009 17:27:32 -0800 Lines: 42 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit