Re: set the clipboard not available in in some apps (like Word)
Re: set the clipboard not available in in some apps (like Word)
- Subject: Re: set the clipboard not available in in some apps (like Word)
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 13 Dec 2004 09:50:53 -0800
On 12/12/04 1:12 PM, "Joseph Weaks" <email@hidden> wrote:
>
>> ...But it's really to do with
>> Word (or Office) having its own clipboard. They'll communicate one-way
>> but
>> not the other way. We've seen that setting the clipboard to a string
>> via
>> AppleScript somehow is transferable to Word's clipboard, so it pastes.
>> Unicode doesn't transfer from the system clipboard to Word's (I expect
>> it's
>> still using an old-fashioned method of getting styles).
>
> I am not queazy about calling this a bug! At best, it's incomplete and
> poor Unicode implementation.
It's been confirmed by MS as a recently discovered bug. What's happening is
this: legacy code in Word is looking just for 'TEXT' (plain text) "flavor"
on the clipboard to see whether the clipboard's state is enabled or not,
rather than also checking 'UTXT' (Unicode text) flavor too. Normally this is
not an issue, since every application that puts UTXT (or styled text or
graphics plus text, etc.) on the clipboard _also_ puts 'TEXT' version there
too. That's why it works fine in the UI. It's _only_ AppleScript's 'set the
clipboard' which doesn't bother to take the precaution of putting a plain
text version for safety.
Frankly, IMO, this is also a "bug" - legacy code in Standard Additions that
has not been brought up to date - that 'set the clipboard' does not take
this same elementary precaution that all applications take. In any case, a
later version of Word will check all flavors on the clipboard.
If you wanted, you could get around this in a Studio app by using 'call
method' with NSPasteboard methods to get your text box or text field data to
the clipboard, rather than 'set the clipboard'. I had to do that in one of
my Studio apps in order to get attributed strings (colored formatted text)
with graphics up there. There's a default for always including the plain
text version, and that would trigger Word's clipboard check. NSPasteboard
methods can get a bit complicated - and of course we're mostly using Studio
so as not to have to learn all that Objective C stuff. But - not for the
first time - it tends to work better...
Anyway - if Chris N. is reading here - this is a request for the Standard
Addition's 'set the clipboard' to always include a plain text 'TEXT' default
flavor _even when_ the text being specified is Unicode text. I can bug this
if need be.
--
Paul Berkowitz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden