Mombu the Computer Design Forum sponsored links

Go Back   Mombu the Computer Design Forum > Computer_Design > Batch Processing, not quite batch
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 13th April 15:26
todd_hil
External User
 
Posts: 1
Default Batch Processing, not quite batch



Did anyone find a solution to the javascript problem? I too am
creating a bookmarking structure which I apply to several do***ents
using batch processing. I had no trouble with version 6.0.05, but when
I upgraded to version 6.0.1, the batch process runs fine on 5 of the
do***ents and then hangs, freezing up the application, to the point
where I have to kill the process using Task Manager.


Below is the script that works fine on any number of pdfs using
6.0.05, but freezes using 6.0.1--Any suggestions?:

--------------Javascript from here to the end --------------
//same for all batches

var root = this.bookmarkRoot;
var bmrChildren = root.children;
if (bmrChildren != null) {
for (var i = 0; i < bmrChildren.length; i++){
bmrChildren[i].remove();
}
}
this.baseURL = "http://***.***/***/";

root.createChild("Reading and Math Literacy Masters
(English)","this.getURL(\"readingliteracy.pdf\")") ;
root.children[0].createChild("Chapter 1",null,0);
root.children[0].children[0].createChild("1A: Graphic
Organizer","this.getURL(\"A10101RA.pdf\")",0);
root.children[0].children[0].createChild("1B: Reading/Writing Math
Symbols","this.getURL(\"A10104RB.pdf\")",1);
root.children[0].children[0].createChild("1C: Reading
Comprehension","this.getURL(\"A10108RC.pdf\")",2);
root.children[0].children[0].createChild("1D:
Vocabulary","this.getURL(\"A1010ARD.pdf\")",3);
root.children[0].createChild("Chapter 2 ",null,1);
root.children[0].children[1].createChild("2A: Graphic
Organizer","this.getURL(\"A10201RA.pdf\")",0);
root.children[0].children[1].createChild("2B: Reading/Writing Math
Symbols","this.getURL(\"A10203RB.pdf\")",1);
root.children[0].children[1].createChild("2C: Reading
Comprehension","this.getURL(\"A10206RC.pdf\")",2);
root.children[0].children[1].createChild("2D:
Vocabulary","this.getURL(\"A1020ARD.pdf\")",3);
root.children[0].createChild("Chapter 3 ",null,2);
root.children[0].children[2].createChild("3A: Graphic
Organizer","this.getURL(\"A10301RA.pdf\")",0);
root.children[0].children[2].createChild("3B: Reading/Writing Math
Symbols","this.getURL(\"A10303RB.pdf\")",1);
root.children[0].children[2].createChild("3C: Reading
Comprehension","this.getURL(\"A10305RC.pdf\")",2);
root.children[0].children[2].createChild("3D:
Vocabulary","this.getURL(\"A1030ARD.pdf\")",3);
root.children[0].createChild("Chapter 4 ",null,3);
root.children[0].children[3].createChild("4A: Graphic
Organizer","this.getURL(\"A10401RA.pdf\")",0);
root.children[0].children[3].createChild("4B: Reading/Writing Math
Symbols","this.getURL(\"A10402RB.pdf\")",1);
root.children[0].children[3].createChild("4C: Reading
Comprehension","this.getURL(\"A10405RC.pdf\")",2);
root.children[0].children[3].createChild("4D:
Vocabulary","this.getURL(\"A1040ARD.pdf\")",3);

NameFileObject = {readingliteracy:"Reading and Math Literacy Masters
(English)", A10101RA:"1A: Graphic Organizer", A10104RB:"1B:
Reading/Writing Math Symbols", A10108RC:"1C: Reading Comprehension",
A1010ARD:"1D: Vocabulary", A10201RA:"2A: Graphic Organizer",
A10203RB:"2B: Reading/Writing Math Symbols", A10206RC:"2C: Reading
Comprehension", A1020ARD:"2D: Vocabulary", A10301RA:"3A: Graphic
Organizer", A10303RB:"3B: Reading/Writing Math Symbols", A10305RC:"3C:
Reading Comprehension", A1030ARD:"3D: Vocabulary", A10401RA:"4A:
Graphic Organizer", A10402RB:"4B: Reading/Writing Math Symbols",
A10405RC:"4C: Reading Comprehension", A1040ARD:"4D: Vocabulary"}
//same for all batches

this.addScript("Open", "app.openInPlace = true;");

function closeUp(bm){
if (bm.children != null){
for (var i = 0; i < bm.children.length; i++){
bm.children[i].open = false;
closeUp(bm.children[i]);
}

}
var rootKids = this.bookmarkRoot.children;
for (var i = 0 ; i < rootKids.length; i++)
rootKids[i].open = true;
}


closeUp(this.bookmarkRoot);

function findBM(bm, bmToFind) {
if (bmFound == true) return bm;
if (bm.name == bmToFind){
global.bmToOpen = bm;
global.bmToOpen.color = color.red;
global.bmToOpen.style = 2;
bmFound = true;
}
if (bm.children != null)
for (var i = 0; i < bm.children.length; i++)
if (bmFound == true){
break;
}
else {
findBM(bm.children[i], bmToFind);
}
}

function openBM(){
var parentBM = null;
var _foundBM = null;
if (global.bmToOpen == null) return;
else{
_foundBM = global.bmToOpen;
while ( (parentBM = getParent(_foundBM)) != null) {
parentBM.open = true;
_foundBM = _foundBM.parent;
}
}
}

function getParent(bm){
return bm.parent;
}

var bmFound = false;
var truncFileName = this.do***entFileName;
truncFileName = truncFileName.substring(0,truncFileName.indexOf(". "));

findBM(this.bookmarkRoot, NameFileObject.eval(truncFileName));
openBM();
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666