If you're script still uses document. exportFile(), nothing will change. For example, the following code will still work:
t = app.activeDocument.exportFile(ExportFormat.pdfType, File("~/Desktop/Test.pdf"));
alert("Task is done")If you want to use the 'background tasks' functionality, you'll need to use document.asynchronousExportFile(). AsynchronousExportFile returns a background task, which has the method waitForTask(). You can use it something like this:
t = app.activeDocument.asynchronousExportFile(ExportFormat.pdfType, File("~/Desktop/Test.pdf"));
t.waitForTask();
alert("Task is done")
This will export your document as a PDF using a background task, wait for the export to complete, and then pop up an alert. The problem is that you loose the advantages of a background task (namely, you can do other things while the file is exporting in the background).
The backgroundTask object has a property status, which returns the status of the task, including TaskState.COMPLETED. You could probably add an event listener to check for the state change from TaskState.RUNNING to TaskState.COMPLETED. When I get a bit more time later, i'll check it out and try to provide some sample code.
Again, if your concern is the behavior of scripts you already have, then nothing should change. If you're looking to take advantage of the new background tasks, then there's some work to do.
/dan