set x to clipboard with formatting?

Hello, I have a applescript studio project that copies values from a text field to the clip board for easy pasting into a email. Question I have is. Is there a way to keep the formatting of the text that it is copying? In my text field I have have the font set to bold and when I say

			tell application "Finder" to set the clipboard to Scustomer 

It comes in as plain text without the bolding

any ideas would be great. Thanks

Hi,

first of all, if you’re planning to paste the text into Mail.app it will fail, because Mail takes only the plain text part.
Here is a workaround
AppleScript Studio is not able to get the formatted text information from a text field.
But it’s possible with a portion of Objective-C

+ (void)copyAttributedTextFromTextField:(NSTextField *)field { NSPasteboard *pb = [NSPasteboard generalPasteboard]; [pb declareTypes:[NSArray arrayWithObjects:NSStringPboardType, NSRTFPboardType, nil] owner:self]; [pb setString:[field stringValue] forType:NSStringPboardType]; NSAttributedString *att = [field attributedStringValue]; NSData *rtf = [att RTFFromRange:NSMakeRange(0, [att length]) documentAttributes:nil]; [pb setData: rtf forType:NSRTFPboardType]; }