Skip to content

Commit 7b33ee7

Browse files
author
Benedikt Gross
committed
added example for processing modes
1 parent 9f8132e commit 7b33ee7

File tree

3 files changed

+42
-5
lines changed

3 files changed

+42
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ to figure all of that out on our own!
2727

2828
Supported Adobe Indesign versions: CS 5, CS 5.5 and CS 6
2929

30-
If you want use Sublime Text instead of Adobe's Extendscript Toolkit, use the buildscript here: [extras/Sublime Text/README.md](extras/Sublime Text/)
30+
If you want use Sublime Text instead of Adobe's Extendscript Toolkit, use the buildscript here: [extras/Sublime Text/](extras/Sublime Text/)

basil.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -271,21 +271,19 @@
271271
*/
272272
pub.MODESILENT = "ModeSilent";
273273
/**
274-
* Used with b.go() to set Performance Mode. Processes Document in background mode. Document will not be visible until the script is done. If you are firing on a open document you'll need to save it before calling bgo(). The document will be removed from the display list and added again aftrer the script is done. In this mode you will likely look at indesign with no open document for quite some time - do not work in indesign during this time. You may want to use b.println("yourMessage") in your script and look at the Console in estk to get information about the process.
274+
* Used with b.go() to set Performance Mode. Processes Document in background mode. Document will not be visible until the script is done. If you are firing on a open document you'll need to save it before calling b.go(). The document will be removed from the display list and added again after the script is done. In this mode you will likely look at indesign with no open document for quite some time - do not work in indesign during this time. You may want to use b.println("yourMessage") in your script and look at the Console in estk to get information about the process.
275275
* @property MODEHIDDEN {String}
276276
* @cat Environment
277277
* @subcat modes
278278
*/
279279
pub.MODEHIDDEN = "ModeHidden";
280280
/**
281-
* Default mode. Used with b.go() to set Performance Mode. Processes Document with Screen redraw, use this option to see direct results during the process. This will slow down the process. This mode was also the default in Versions prior to 0.22
281+
* Default mode. Used with b.go() to set Performance Mode. Processes Document with Screen redraw, use this option to see direct results during the process. This will slow down the process in terms of processing time. This mode was also the default in Versions prior to 0.22
282282
* @property MODEVISIBLE {String}
283283
* @cat Environment
284284
* @subcat modes
285285
*/
286286
pub.MODEVISIBLE = "ModeVisible";
287-
288-
//Used in b.go(Optional: mode). Disables ScreenRedraw, this is the default mode
289287
pub.DEFAULTMODE = pub.MODEVISIBLE;
290288

291289

examples/environment/modes.jsx

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#includepath "~/Documents/;%USERPROFILE%Documents";
2+
#include "basiljs/bundle/basil.js";
3+
4+
function draw() {
5+
// keep indesign busy
6+
for (var i = 0; i < 500; i++) {
7+
var x = b.random(0,b.width);
8+
var y = b.random(0,b.height);
9+
b.ellipse(x,y,17,17);
10+
};
11+
}
12+
13+
// -- MODEVISIBLE --
14+
// Processes Document with Screen redraw, use this option to see direct
15+
// results during the process. This will slow down the process in terms
16+
// of processing time.
17+
18+
// -- MODESILENT --
19+
// Disables ScreenRedraw during processing. A bit faster, as the document is
20+
// not redrawn during processing.
21+
22+
// -- MODEHIDDEN --
23+
// Processes Document in background mode. Document will not be
24+
// visible until the script is done. If you are firing on a open document
25+
// you'll need to save it before calling b.go(). The document will be removed
26+
// from the display list and added again after the script is done. In this
27+
// mode you will likely look at indesign with no open document for quite some
28+
// time - do not work in indesign during this time. You may want to use
29+
// b.println("yourMessage") in your script and look at the Console in estk to
30+
// get information about the process.
31+
32+
// and now, compare the executing times in the console ...
33+
// on my machine i had 10s (MODEVISIBLE), 8s (MODESILENT), 3.5s (MODEHIDDEN)
34+
35+
b.go(); // same as writing: b.go(b.MODEVISIBLE)
36+
37+
//b.go(b.MODESILENT);
38+
39+
//b.go(b.MODEHIDDEN);

0 commit comments

Comments
 (0)