> Don't know about 8.3 but your script works in 10.3.3 with CW Pro 9.2 .
>
[quoted text clipped - 11 lines]
>
> -- end script
> > Don't know about 8.3 but your script works in 10.3.3 with CW Pro 9.2 .
> >
[quoted text clipped - 18 lines]
> error. The very strange thing is that it always works for literal
> strings, and never works for strings that I pull in from the outside.
Ahh, this rings a bell now. I think that the OS now says that this is
typeStyledText when it previously sent it as typeChar. Since there is
no automatic conversion between the two and the IDE is only asking for
typeChar, the Apple Event fails. Which IDE version are you using? We
fixed this but I don't recall when it was done (maybe in the Pro 9 or
9.1 IDE).
> I.e.
>
[quoted text clipped - 29 lines]
>
> -Chad
You could use the COM API in the IDE for this and it won't have the
Apple Event problems you're running into. I've got something I can send
you to help get you started if you want it. Just send me an e-mail if
you do.

Signature
Isaac Wankerl
Metrowerks
Chad J McQuinn - 25 May 2004 22:14 GMT
> Ahh, this rings a bell now. I think that the OS now says that this is
> typeStyledText when it previously sent it as typeChar. Since there is
> no automatic conversion between the two and the IDE is only asking for
> typeChar, the Apple Event fails. Which IDE version are you using? We
> fixed this but I don't recall when it was done (maybe in the Pro 9 or
> 9.1 IDE).
Isaac,
Thanks for your response. I am using CW Pro 8.3 on OS 10.3.3. Do you
know if there's some way in applescript to do a manual conversion to
typeChar? I always thought that the "foo as text" stuff did the same
basic thing as AECoerceDesc.
> You could use the COM API in the IDE for this and it won't have the
> Apple Event problems you're running into. I've got something I can send
> you to help get you started if you want it. Just send me an e-mail if
> you do.
Sure, that would be great! It's been sent.
Thanks,
-Chad
Chad J McQuinn - 27 May 2004 02:10 GMT
> > Ahh, this rings a bell now. I think that the OS now says that this is
> > typeStyledText when it previously sent it as typeChar. Since there is
> > no automatic conversion between the two and the IDE is only asking for
> > typeChar, the Apple Event fails.
...
> Do you
> know if there's some way in applescript to do a manual conversion to
> typeChar? I always thought that the "foo as text" stuff did the same
> basic thing as AECoerceDesc.
To answer my own question here, the following applescript works correctly
-----
set thetext to «class ktxt» of ((the clipboard as text) as record)
tell application "CodeWarrior IDE"
set text of document 1 to thetext
end tell
-----
where the first line is to work around the problem Isaac described. The
"«" and "»" characters around "class ktxt" are typed on a US keyboard
with "option-\" and "shift-option-\".
-Chad