Re: Send events to AppleScript
Re: Send events to AppleScript
- Subject: Re: Send events to AppleScript
- From: Тимофей Даньшин <email@hidden>
- Date: Sat, 21 Mar 2009 19:50:35 +0300
As far as TextEdit is concerned, i thought of taking its source and
modifying it to my needs, and actually create a single application,
not a tandem of two or more. I am even beginning to think of taking
the OppenOffice as the host for my additional functionality, but OO
doesn't look at all stable. Are there any libraries out there that
could access all (or at least the most common) elements of .doc, docx
and RTF documents besides NSDocument? It doesn't really matter if they
can render page layout correctly, the important thing is that they
could access and modify those elements.
On Mar 21, 2009, at 7:28 PM, has wrote:
On Mar 21, 2009, at 12:09 PM, Тимофей Даньшин wrote:
Well, I'm writing a "translation memory" application, which is a
program that grabs sentence by sentence from a given text (that
needs translating), asks the user to translate that sentence and
stores the translation and the original in a database. If the user
comes across the same sentence again in the future, he or she will
not need to translate it again.
I thought i would take the TextEdit app as the text editing part of
my project, but as I wrote the database management and the search
parts, it turned out that TextEdit is not capable of correctly
interpreting word files or RTF's (ie it ignores footnotes, headers/
footers and a lot of other stuff). That is why I am trying to find
out how i can communicate with Word or Pages.
As far as what I would want from an AppleScript (if I were to use
AppleScript) is to be able to receive notifications from Word when,
for example, the user has hit a certain key combination, to know
where the insertion point (or selection) is in Word and to receive
notifications when it moves, to be notified when a user is trying
to edit something and prevent him/her from doing so if that part of
the text should not be edited.
Receiving those notifications, that script would just redirect them
to my application and receive responses to them and redirect them
to Word.
It is rare to find applications that provide notifications, and
almost unheard of for them to provide notifications of minor events
such as text edits. You certainly won't get the sort of
notifications you describe from TextEdit, Word or Pages. ISTR a
third-party tool that allows you to attach AppleScripts to the GUI
objects of another application, but that sort of thing is inherently
hackish, prone to breakage, and liable not to go down too well with
increasingly security conscious software and users. I suspect your
best bet would be to poll the application, bearing in mind that
might create its own issues (e.g. performance/responsiveness).
HTH
has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden