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

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

–Check If this script runs in foregroundifnot (current application’sNSThread’sisMainThread()) asbooleanthendisplay alert“This script must be run from the main thread (Command-Control-R in Script Editor).”buttons {“Cancel”} ascriticalerrornumber-128endif

–Check If this script runs in foregroundifnot (current application’sNSThread’sisMainThread()) asbooleanthendisplay alert“This script must be run from the main thread (Command-Control-R in Script Editor).”buttons {“Cancel”} ascriticalerrornumber-128endif