FROM : Christopher Nebel
DATE : Mon Apr 14 19:03:23 2008
On Apr 14, 2008, at 8:24 AM, Oliver Quas wrote:
> Am 14.04.2008 um 16:58 schrieb Florian Soenens:
>>
>>
>
>>> on 4/14/08 8:26 AM, <email_removed> purportedly said:
>>>
>>>> Re-read my message. If it was unclear, what I want to do is be
>>>> able to
>>>> log (record) text being written to a chat window from another
>>>> app. NOT
>>>> log key strokes. For example, how could I progmatically record
>>>> an AIM
>>>> chat conversation from my app?
>>>
>>> You can't, at least not without the application's cooperation,
>>> such as being a plugin, using OSA, etc. With a *user's* (or
>>> administrator's) cooperation, you could have an app that acts as a
>>> proxy. Another option would involve a kernel extension, and that
>>> may be more work than it is worth.
>
> Under the premise that your Chat-Client supports AppleScript, why
> not use the ScriptingBridge?
Because Scripting Bridge is for controlling other applications, not
for writing handlers that an application will call.
Mr. Arnel's answer is basically correct -- you're going to need the
target application to give you some hooks to hang your recorder on.
(Unless you want to do something grungy like a kernel extension, that
is.) Some chat clients provide such hooks as part of their
scriptability. For example, iChat in Leopard has a rather extensive
set of handlers that you can attach AppleScript scripts to, and from
there you can do what you like -- in your case, you'd want the
"message received" handler. You never specified the application you
were interested in, but take a look at its scripting interface (drop
it on Script Editor) and see if something looks promising.
--Chris Nebel
AppleScript Engineering
DATE : Mon Apr 14 19:03:23 2008
On Apr 14, 2008, at 8:24 AM, Oliver Quas wrote:
> Am 14.04.2008 um 16:58 schrieb Florian Soenens:
>>
>>
>
>>> on 4/14/08 8:26 AM, <email_removed> purportedly said:
>>>
>>>> Re-read my message. If it was unclear, what I want to do is be
>>>> able to
>>>> log (record) text being written to a chat window from another
>>>> app. NOT
>>>> log key strokes. For example, how could I progmatically record
>>>> an AIM
>>>> chat conversation from my app?
>>>
>>> You can't, at least not without the application's cooperation,
>>> such as being a plugin, using OSA, etc. With a *user's* (or
>>> administrator's) cooperation, you could have an app that acts as a
>>> proxy. Another option would involve a kernel extension, and that
>>> may be more work than it is worth.
>
> Under the premise that your Chat-Client supports AppleScript, why
> not use the ScriptingBridge?
Because Scripting Bridge is for controlling other applications, not
for writing handlers that an application will call.
Mr. Arnel's answer is basically correct -- you're going to need the
target application to give you some hooks to hang your recorder on.
(Unless you want to do something grungy like a kernel extension, that
is.) Some chat clients provide such hooks as part of their
scriptability. For example, iChat in Leopard has a rather extensive
set of handlers that you can attach AppleScript scripts to, and from
there you can do what you like -- in your case, you'd want the
"message received" handler. You never specified the application you
were interested in, but take a look at its scripting interface (drop
it on Script Editor) and see if something looks promising.
--Chris Nebel
AppleScript Engineering






Cocoa mail archive

