forked from ff6347/extendscript-console
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconsole.jsx
60 lines (45 loc) · 1.2 KB
/
console.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
* function template by @author fabiantheblind
*/
(function(thisObj){
// basic panel
run(thisObj);
/**
* [run description]
* @param {[type]} thisObj [description]
* @return {[type]} [description]
*/
function run(thisObj){
main();
function main(){
var console = new Console();
// sometimes you have to add an delay(seconds) to see whats going on
// for(var i = 0; i < 10; i++){
console.log("main function start" );
delay(3);
// }
console.close();// and we are done
}
// function initConsole(){
// var console = new Window("palette"); // for logging some data to the screen
// console.prompt = console.add("statictext",[0,0,500,20]);
// console.show();
// return console;
// }
// delay function found here
// found here http://www.wer-weiss-was.de/theme157/article1143593.html
function delay(prmSec){
prmSec *= 1000;
var eDate = null;
var eMsec = 0;
var sDate = new Date();
var sMsec = sDate.getTime();
do {
eDate = new Date();
eMsec = eDate.getTime();
}
while ((eMsec-sMsec)<prmSec);
}
}
// close run
})(this);