Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'i got this working, here's the script:' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
i got this working, here's the script:
Authored by: paulrob on Feb 15, '04 07:32:43AM
This is excellent! Does what it says on the tin! Well, almost. Although you get bolds etc, it isn't plain text - the font is Geneva. For some reason Applescript assigns what you might expect to be a plain text to a Geneva font! See my previous post on this. And the original poster's comments. It's to do with the seed value "x" on the line: -

tell sttr to copy StyledTextToRecord("x" as Unicode text) to defaultStyleInfo
Unfortunately, Applescript assigns this "x" a Geneva font right from the start. Therefore, Gevena becomes the default font for the clipboard. I tried the following as a replacement, based on what the original poster said: -

set seed_char to «class ktxt» of (("x" as Unicode text) as record)
tell sttr to copy StyledTextToRecord(seed_char) to defaultStyleInfo
but now the handler throws up an error claiming the clipboard has non-styled text. Sounds like a bit of work on the handler might straighten this out, and then you would have "real" plain text with style info, but not font.

[ # ]