Autorunning code at application statup

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Autorunning code at application statup

Manuel Odesser
Hi,

After having search the web (especially http://www.oooforum.org/ and
this list's archive), I could not find a way to achieve this goal :
autorunning a piece of code on application startup (or text document
loading).

I am perfectly aware that this could be used for a naughty purpose, but
I aim to run a typography checker in the background in swriter. My code
(distributed as an extension) works fine, but it is a real pain to have
it started each time I type in a text document. Moreover, in the end,
this will *not* be used by end users because they will not activate the
checker. I may not patch the sources, the solution must be
cross-platform and it has to be embedded in the extension.

Is this goal achievable ? How ? Thank you very much for your answers.

--
Manuel Odesser
Ingénieur Web
LINAGORA SA - http://www.linagora.com/
Tél.: +33(0)1 58 18 68 28 - Fax : +33(0)1 58 18 68 29

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Autorunning code at application statup

Mathias Bauer
Manuel Odesser wrote:

> Hi,
>
> After having search the web (especially http://www.oooforum.org/ and
> this list's archive), I could not find a way to achieve this goal :
> autorunning a piece of code on application startup (or text document
> loading).
>
> I am perfectly aware that this could be used for a naughty purpose, but
> I aim to run a typography checker in the background in swriter. My code
> (distributed as an extension) works fine, but it is a real pain to have
> it started each time I type in a text document. Moreover, in the end,
> this will *not* be used by end users because they will not activate the
> checker. I may not patch the sources, the solution must be
> cross-platform and it has to be embedded in the extension.
>
> Is this goal achievable ? How ? Thank you very much for your answers.

That's what "jobs" are fore. There is a chapter in the developers guide
describing them. An alternative would be to write a basic macro that
starts your code and bind the macro to the event "Start application".
But as your code is already deployed as an extension it should be easy
to add a job to it. This will also allow you to start your code only for
certain types of documents, see chapter about Add-Ons in the DevGuide.

If you have more questions about this you should go to the
[hidden email] mailing list.

Best regards,
Mathias


--
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [hidden email] is a spam sink.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]