–スタイル付きテキストを指定フォルダ（POSIX path）にPDFで書き出しonsaveStyledTextAsPDF(aFileName, targFol, aStyledString)– get page size being used for printingsetprintInfotocurrent application’sNSPrintInfo’ssharedPrintInfo()setpageSizetoprintInfo’spaperSize()settheLefttoprintInfo’sleftMargin()settheToptoprintInfo’stopMargin()

– get the types of data stored on the pasteboard itemsettheTypesto (itemioftheItems)’s types()

– for each type, get the corresponding data and store it all in the new pasteboard itemrepeatwithjfrom1tocountoftheTypessettheDatato ((itemioftheItems)’s dataForType:(itemjoftheTypes))’s mutableCopy() – mutableCopy makes deep copyiftheDataisnotmissing valuethen (newPBItem’ssetData:theDataforType:(itemjoftheTypes))endifendrepeat