Page 1 of 1

Running framework code on document open event

Posted: Wed Nov 09, 2016 4:12 pm
by peterls
I've got a custom framework that defines several operations users can invoke from menus or through hotkeys. For example an operation could be to contact an external web service and insert an XML fragment in the current document based on the response.

What I need now is to invoke one of those operations automatically whenever a new document (that is associated with that framework) is opened. Is there a way to do this?

I know I could do it easily via a plugin but I don't want to duplicate my code if it was possible.

Re: Running framework code on document open event

Posted: Wed Nov 09, 2016 6:16 pm
by mihaela
Hi,

The only way to invoke the operation when the document is opened is to create a plugin (as you already said).
A custom action can be also invoked through CSS, by using the oxy_action() function, but this action should be associated with a button form control.You cannot invoke it on document open.

Best Regards,
Mihaela