scripting
Don Ireland
gnucash at donireland.com
Fri May 20 10:33:32 EDT 2016
Ok thanks for the information everyone.
On May 20, 2016 9:23:43 AM CDT, John Ralls <jralls at ceridwen.us> wrote:
>
>> On May 20, 2016, at 5:26 AM, yary <not.com at gmail.com> wrote:
>>
>> On Fri, May 20, 2016 at 2:52 AM, Colin Law <clanlaw at gmail.com> wrote:
>>> On 19 May 2016 at 22:27, Don Ireland <gnucash at donireland.com> wrote:
>>>> ...
>>>>
>>>> Related Q: is it possible to write a script that interacts with GC
>while
>>>> it's running? I'm thinking about an event handler that fires when
>performing
>>>> certain tasks.
>>>
>>> I don't see how that is related to how the data are stored.
>>
>> Not sure about scripting a running GnuCash instance.
>>
>> You can use the API to read and manipulate the data in your own
>> program. And if the data is stored in a database format, and the
>> database supports triggers, then you can have the database run code
>> when data changes in a certain way. I would not try changing the
>> database (or the XML representation) of a running instance behind its
>> back, I'd only use triggers for reporting, logging, or writing to
>some
>> different system.
>
>There are numerous hooks and events in GnuCash for triggering actions,
>and there's a Scheme interpreter running, so if what you want to do can
>be triggered by an existing hook you can register your Scheme code to
>that hook. The same capability exists in theory for Python, though it's
>a bit more work and requires building with --enable-python. There's an
>example python console in src/python/pycons.
>
>None of this is documented so you'll have to study the code and the
>developer docs (http://code.gnucash.org/docs/MAINT) to learn how to add
>your scripts.
>
>Regards,
>John Ralls
>
>
>_______________________________________________
>gnucash-user mailing list
>gnucash-user at gnucash.org
>https://lists.gnucash.org/mailman/listinfo/gnucash-user
>-----
>Please remember to CC this list on all your replies.
>You can do this by using Reply-To-List or Reply-All.
Don Ireland
More information about the gnucash-user
mailing list