Jeremy, Thanks. Yes I did find tm-perform-import and the code.
This is really part of the discussion about unrolling some internal logic > so that it is expressed in wikitext, and can be more easily customised. > > https://github.com/Jermolene/TiddlyWiki5/issues/3967 > Totally agree and this is why I raised it at this point in time. It’s important to understand that the $:/Import tiddler must conform to > the format of a plugin, it’s not a generic JSON tiddler. It’s a temporary > holding cell for incoming tiddlers. Note that it holds the tiddlers that > are to be imported, not the original data that was dropped. I see this but I not so sure I understand the implications "conform to the format of a plugin" other than it has a plugin type. > With that out of the way, the actions of handlePerformImportEvent are: > > 1. Import those tiddlers where field named “selection-“ plus the title of > the tiddler does not contain the string “unchecked”. So the field > “selection-HelloThere” is used to hold the status of the checkbox next to > the tiddler “HelloThere”. > 2. Replace the $:/Import tiddler with a report of which tiddlers were > imported > 3. Navigate to $:/Import > 4. Trigger an autosave event > It seems that handlePerformImportEvent is doing a lot and perhaps it could be opened up a bit. I have bypassed Step 2 by providing a button that allows $:/import to be copied to a json tiddler before it is replaced. > It seems that this message automatically deletes the source tiddler. Is > there any way to override this behaviour? > > Not at present, but we could conceivably add parameters to the message > that allow finer control over the actions performed. > Perhaps this could stay as is and we provide an other message(s) that opens the hackability of the import process, features can already be added to the existing import mechanism with an additional view template item as I have done, or modifying the existing import view template. The need for more hackability exists to do things like; - Silent Import on StartActions - Click to import from URL with or without selection - Import filename text, json, tid file to a tiddler as the tiddlers body or other field - without extracting tiddlers. > As ever, you’d be best making a plan that doesn’t require core > modifications up front. In this case, that means making a plugin that does > the new stuff, if necessary copying and pasting code from the core. > I was only trying to do this as a Proof of Concept, but my script kiddy hack failed. Thanks for your considered response. Tony -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/ac47f002-80ab-4466-9353-b72470039b87%40googlegroups.com.
