Re: Cocoa AppleScript: selection, inserting?
Re: Cocoa AppleScript: selection, inserting?
- Subject: Re: Cocoa AppleScript: selection, inserting?
- From: Brian Webster <email@hidden>
- Date: Fri, 12 Oct 2001 20:14:42 -0500
On Friday, October 12, 2001, at 02:46 PM, cocoa-dev-
email@hidden wrote:
In fact, even just getting the selection using
set theSelection to selection
yields the same error. Using this particular snippet with the Finder,
for example, works fine, TextEdit has the same error.
This is because neither Sketch nor TextEdit defines a selection
object anywhere in their dictionaries.
Example 2:
Trying to insert text into a TextEdit document:
<snipped examples>
The following is from the release notes for Scripting under
"Known Problems":
(/Developer/Documentation/ReleaseNotes/Scripting.html)
Problem: The current implementation of the Text suite has
performance problems and correctness problems.
Description: The Text suite is mostly supported, but it
currently has some serious limitations. The main one is
performance. There are several areas of the current
implementation that are known to be totally inadequate
performance-wise. Also, certain commands (especially Move, but
including others as well) either won't work at all, or won't
work as well as they should.
The text suite, since it is implemented entirely within the
Scripting system, will be able to be fixed without your
application ever having to change or be recompiled. A future
release should address the performance and correctness problems
with the current implementation.
In the meantime, your application should still expose
NSTextStorage objects in its container hierarchy where it makes
sense.
For now, we recommend avoiding working with large amounts of
text through scripts.
--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster