func init // checks installation Adobe Indesign include("AdobeIndesign") // adds assembly references if(this.props("VersionCS").value == '5.0') sys.add_assembly('Interop.InDesign', 'Interop.InDesign.dll', 'assembly\\AdobeCS5.0\\') elseif(this.props("VersionCS").value == '5.5') sys.add_assembly('Interop.InDesign', 'Interop.InDesign.dll', 'assembly\\AdobeCS5.5\\') elseif(this.props("VersionCS").value == '6.0') sys.add_assembly('Interop.InDesign', 'Interop.InDesign.dll', 'assembly\\AdobeCS6.0\\') end // initialize instance if(linked("doLoad") and linked("Profile")) sys.add_var(this.name, 'id.PreflightProfile') end // 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 end func make_profile(data) return(this._id + '.LoadPreflightProfile(' + d("FileName") + ')') end func doLoad(data) if(not isdef("Indesign")) linked("onError") ? blk.println('try {').inc() : '' if(linked("Profile")) blk.println(this.codename, ' = ', make_profile(data), ';') event("onComplete", this.codename) else event("onComplete", make_profile(data)) end if(linked("onError")) blk.dec().println('} catch(Exception ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end end func Profile if(linked("doLoad")) return(this.codename) else return(make_profile()) end end