Article View: adobe.scripting.indesign
Article #9407Re: Progress of script running
From: LaOs
Date: Fri, 18 Aug 2006 17:51
Date: Fri, 18 Aug 2006 17:51
25 lines
1657 bytes
1657 bytes
I found this snippet at The Photoshop Scripting Community
<http://www.ps-scripts.com/>
All credits goes to Patrick:
<http://www.ps-scripts.com/bb/viewtopic.php?t=786>
It uses the UI and works in ExtendScript Toolkit, but i have not yet tried it in an InDesign script:
// establish how much of the bar is filled = 0;
// build dialog window
var win = new Window("dialog{text:'progress bar',bounds:[100,100,240,180],\
runBtn:Button{bounds:[20,50,120,70] , text:'Add 5%' },\
progress:Progressbar{bounds:[20,10,121,20] , minvalue:0,maxvalue:100,value:" + i + "}\
};"
);
// button to add 5% to the bar
win.runBtn.onClick = function() {
// this will animate the bar to 80%
while (i <= 80) { win.progress.value = i; i++; $.sleep(10); }; // if (i <= 95) { // add 5% if the bar is less than 95% full i = i+5; i = parseInt(i); win.progress.value = i; } else { // reset bar to zero if you have reached 100% alert("You have reached 100%!"); i = 0; win.progress.value = i; }; };
// show user the dialog window
win.center();
win.show();
Technical Details
Message-ID:
<3bc0ded9.8@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossingReferences:
<3bc0ded9.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,92cf7912f3089433 X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: LaOs@adobeforums.com Newsgroups: adobe.scripting.indesign Subject: Re: Progress of script running Message-ID: <3bc0ded9.8@webcrossing.la2eafNXanI> Date: Fri, 18 Aug 2006 10:51:27 -0700 References: <3bc0ded9.-1@webcrossing.la2eafNXanI> Lines: 46 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossing