klaas1979 / tablesmith-like

Use Tablesmith-like tables in FoundryVTT and create complex nested tables.
MIT License
3 stars 5 forks source link

Outputing results to a journal #3

Closed Lyinggod closed 2 years ago

Lyinggod commented 2 years ago

I am very new to Foundry and I have basic understanding of JS. Is it possible to capture output from this module and send it to a journal instead of chat or the evaluation window. I have found a macro, which I have not tested yet, that will create a new journal and add a string so, hopefully, all I need is a push in the right direction.

Lyinggod commented 2 years ago

To clarify my intent. I intend to have scripts that will generate significant information such as town data, npc/pc backgrounds, etc. If allowed, the option for each script output being a potentially new journal (ie new journal is created by something like {NewJournal~foldername,journalname} ) or adding the output to the end of an existing journal (ie {JournalEntry~journalname,output}.

klaas1979 commented 2 years ago

It is a feature on my todo list. Basically the whole plugin is rough on all edges, as Tablesmith Functions are missing and the GUI not thought out. What would you envision, a Button in the form 'To Journal' with a Journal preconfigured via the settings. Or should it be a selectable Journal for each table roll?

The question is, are you using the GUI to generate the output? I have planed to add buttons to the GUI with a 'To Chat' and 'To Journal' funtionality, to have the option to preserve the results after the table was rolled.

As of now I would not start to extend the Tablesmith Functions to keep basic functionality.

Lyinggod commented 2 years ago

Ideally, both a button to output to a new or existing journal as well as a command. Some scripts may always output to a journal (ie due to size or are best suited as an individual journal) while a button can be used on other scripts, after being executed, to determine whether the output should go to either a new journal, an existing journal (at the bottom?), or to chat.

Lyinggod commented 2 years ago

Also being able to take advantage of the HTML markup of the journals would be nice. such as

:Start 1,<h2>[townname]</h2> _[towndetails]

or perhaps 1, {h2~[townname]}

klaas1979 commented 2 years ago

Please do not mix issues, as is it gets complicated to sort them out. The scond thing I do not understand html markup is working fine for me. If I add the feature to export to Journal, the export would be with full markup, as in the Chat Texts.

klaas1979 commented 2 years ago

Version 1.5.0 has a basic Journal appending function, via API or the Form. The Journal that is appended to via the form is configured by Module settings. The Journal used by the API is more flexible, as it can be configured via options (see the extended Macro in the compendium).