6/16/2023 0 Comments Plain text clipboardThe easiest way to use PureText is to simply use its Hotkey to paste text instead of using the standardĬTRL+V Hotkey that is built into most Windows applications. Right-click on the icon to display a menu with more options. You can click on this icon to remove formatting from the text that is currently on the clipboard. Pasted text will be pure and free from all formatting.Īfter running PureText, you will see a "PT" icon appear near the clock on your task bar. Better yet, you can configure a PureText Hotkey to convert and paste the text for you. Just copy/cut whatever you want to the clipboard, click on the PureText tray icon, and then paste to anyĪpplication. Have you ever copied some text from a web page or Word document, and wanted to paste it as plain text intoĪnother application without getting all the formatting from the original source? PureText makes this simple. The resulting pure text to the active window with a single hotkey. 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.PureText is a tiny tray utility that removes all text formatting from your clipboard and optionally pastes 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 defaultStyleInfobut now the handler throws up an error claiming the clipboard has non-styled text. Therefore, Gevena becomes the default font for the clipboard. 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 defaultStyleInfoUnfortunately, Applescript assigns this "x" a Geneva font right from the start. For some reason Applescript assigns what you might expect to be a plain text to a Geneva font! See my previous post on this. 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. ![]() property sttr : missing value-> modify the following as neededif sttr is missing value then set sttr to load script alias "Macintosh HD:Library:Scripts:StyledTextToRecord:StyledText Record.scpt"end ifdisplay dialog "I will take the contents of the clipboard (styled text, please) and convert everything to plain text, except for bolds and italics" with icon noteset clipContents to (the clipboard) as styled texttell sttr to copy StyledTextToRecord(clipContents) to styleInfo-> get default styles to reset alltell sttr to copy StyledTextToRecord("x" as Unicode text) to defaultStyleInforepeat with i from 1 to count styleInfo's stylesOn set x to styleInfo's stylesOn's item i if x is not end repeatset the clipboard to (sttr's RecordToStyledText(styleInfo))beep 2here's the forum page where people helped me figure this out: Link As record splits out the style and text portions, and »class ktxt» grabs the plain text portion of that. ![]() ![]() However, If you have quick access to AppleScripts through Apple's Script Menu or iKey, then the following line of AppleScript will remove the formatting and leave the plain text (which should then take on the default formatting of whatever program you are pasting it into): set the clipboard to «class ktxt» of ((the clipboard as text) as record)How it works: The as text portion grabs the stylized text from whatever other junk may be surrounding it (which can be significant). for the text to make it look like the text I'm pasting it beside. The problem is that when I paste the text, it brings along the style of other program, which means I now have to change font, weight, size, etc. ![]() I frequently find myself wanting to copy and paste text between two programs that use completely different styles for their text.
0 Comments
Leave a Reply. |