func init // checks installation Adobe Indesign include("AdobeIndesign") // initialize instance sys.add_var(this.name, 'id.PreflightProcess') // initialize properties if(isdef("Indesign")) warning(this.name + ' - manager does not defined') else this._id = sys.get_undef_manager("Indesign") this.setfield('ex', 'ex' + this.id) end // make methods for properties sys._prop_init('AggregatedResults', 1, 0, 0) sys._prop_init('AppliedProfile', 1, 0, 0) sys._prop_init('Description', 1, 0, 0) sys._prop_init('EventListeners', 1, 0, 0) sys._prop_init('Events', 1, 0, 0) sys._prop_init('Index', 1, 0, 1) sys._prop_init('IsValid', 1, 0, 104) sys._prop_init('Parent', 1, 0, 0) sys._prop_init('ProcessInventory', 1, 0, 2) sys._prop_init('ProcessResults', 1, 0, 2) sys._prop_init('TargetObject', 1, 0, 0) this.setfield('ex', 'ex' + this.id) end func doPreflight(data) linked("onError") ? blk.println('try {').inc() : '' if(not linked("Profile") and not isdef("Profile")) blk.println('foreach (id.PreflightProfile idpp in ', this._id, '.PreflightProfiles) {').inc() .println('if (idpp.Name == ', this.props("Profile").value,') {').inc() .println(this.codename, ' = ', this._id, '.PreflightProcesses.Add(', d("Document"), ', idpp);') .println('break;') .dec().println('}') .dec().println('}') else blk.println(this.codename, ' = ', this._id, '.PreflightProcesses.Add(', d("Document"), ', ', d("Profile"), ');') end blk.println(this.codename, '.WaitForProcess(', (isdef("WaitTime") ? '' : this.props("WaitTime").value), ');') event("onComplete", this.codename + '.ProcessResults') if(linked("onError")) blk.dec().println('} catch(Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func doDelete blk.println(this.codename, '.Delete();') end func doSaveReport blk.println(this.codename, '.SaveReport(', this.props("FileName").value, ');') end