'From etoys4.0 of 9 October 2008 [latest update: #2236] on 17 July 2009 at 4:12:25 pm'! "Change Set: macClipFix-bf Date: 17 July 2009 Author: Ted Kaehler/Bert Freudenberg This is derived from Ted's unicodeMacExternal changeset: TK: After the latest Unicode cut and paste changes, text copied from Eudora on a Mac could not be pasted. I revivied some old code for when the latest conversion fails. Now both unicode and older Mac text from outside Squeak can be pasted. BF: Convert from MacRoman charset to Unicode. BF: ... and make sure we answer a Text not String. BF: ... and convert LFs to CRs. BF: ... and refactor the whole so it makes sense and is less verbose"! !ExtendedClipboardMacInterface methodsFor: 'general-api-read' stamp: 'bf 7/17/2009 15:45'! readByteStringClipboardData ^(self readClipboardData: 'com.apple.traditional-mac-plain-text') ifNotNilDo: [: bytes | bytes asString macToSqueak] ! ! !ExtendedClipboardMacInterface methodsFor: 'general-api-read' stamp: 'bf 7/17/2009 15:49'! readStringClipboardData | string | string := self readUTF8StringClipboardData. string ifNil: [string := self readWideStringClipboardData]. string ifNil: [string := self readByteStringClipboardData]. ^string ! ! !ExtendedClipboardMacInterface methodsFor: 'general-api-read' stamp: 'bf 7/17/2009 16:09'! readTextClipboardData ^self readStringClipboardData ifNotNilDo: [:string | (string replaceAll: Character lf with: Character cr) asText] ! ! !ExtendedClipboardMacInterface methodsFor: 'general-api-read' stamp: 'bf 7/17/2009 16:09'! readUTF8StringClipboardData ^(self readClipboardData: 'public.utf8-plain-text') ifNotNilDo: [:bytes | bytes asString utf8ToSqueak] ! !