Export thumbnails to Bridge

The script for InDesign CS3 that allows our editor in chief, art director, advertising manager and everybody interested to watch the process of designing pages online.

There are two scripts involved in the process:
Script #1 Registers afterSave event (should be placed into Start Up folder)
Script #2 creates thumbnails of every page in the current document whenever a designer saves it.

Here is a short description of how it works:
Each time when afterSave event is captured, script #1 triggers script #2, which, at first, checks the file name, and if the characters from 3 to 5 is a number in the range from 730 to 999 it continues. Then it checks if the folder with the name corresponding to the current issue exists, if not, the script offers to create it. Finally, the makeJPEGfile function is run, which exports every page to a separate jpeg file, the name of the file corresponds to the page number.

Note: All files in our workflow are named in the following way: q_789_12-15.indd, where 789 is the current issue number, 12-14 is page range of the article, "q_" — just means nothing.