Forum Bugs

Outputing a csv file with page+content details

shivaram
May I know if its possible to create a csv at run time and write some info (like title, pagenum, etc) to it? I created a simple scenario below for easy understanding.
roottag:before{
    content: prince-script(openfile, page)
}
section, chapter, backmatter{
    content: prince-script(writefile, page, content())
}
function openfile(){
   var file = new File('c:\test.csv');
    file.open('w');
    file.close();
    return null;
}
function writefile(page, text){
    file.open('a');
    file.write(page + ' - ' + text);
    file.close();
    return null;
}

Kindly let me know your thoughts?
mikeday
Prince doesn't support the File API, but you can write to the console. However it may be easier to do this by iterating over the box tree in the oncomplete event handler instead of using prince-script.