I'm looking for a way to simplify the task of selecting from org-tree using hooking into the org-refile function. It is known that through org-org refile it is possible to select certain subtrees and copy them under defined org-heading.
I don't need to copy all the content selected in the standard way from the subtree, but only take certain elements from the selected subtree such as:
- todo-state from the parent heading. It ignores parent heading id/tags since it play as name of this group.
- tags and id (from the properties) of each of the child headings. It is advisable to put it in a table. Tags and todo are compiled into 1 column.
Take a look at this example. This is selection from large org-tree in the same file.
***** HEADER certain ways
****** some problem :Title:
:PROPERTIES:
:ID: 2022-06-07-09-24_some_problem
:END:
some content
***** SOLUTION where is solution living
****** read this topic :Topic:
:PROPERTIES:
:ID: 2022-04-23-topic
:END:
****** get the plan :One_way:
:PROPERTIES:
:CREATED: [2022-03-31 Thu 21:02]
:ID: 2022-06-06-15-12_get_the_plan
:END:
some content
the result will be not all selected subtrees but only their 'map' with IDs and tags which may be processed by requesting actual headings of large tree in the same file. Result.
| Article part | ID |
-----------------------------------------------------------------
| Header Title | id:2022-06-07-09-24_some_problem |
| Solution Topic | id:2022-04-23-topic |
| Solution One_way | id:2022-06-06-15-12_get_the_plan |
For a while I've modified a snippet from this answer. But it requires additional step to copy all selected subtrees and then run this code under selection.
I'll be glad if it is possible to erase this step and compile such 'map' during org-refile process. Think it is possible through the org-refile hook. In my case the sequence of headings/IDs one by one is important.