Hi community.
Need to pick your brains again.
Trying to make a workflow for searching for a project name in a taskpaper document.
if project name already exists - add a new task under it (THAT part I have covered...)
if project name does not exist, move to end of document, add empty line, add project, empty line, add task (that is the 'driving me nuts' part :( ).
here my workflow so far:
http://www.editorial-workflows.com/workflow/5848635073888256/esJq8J99gPk
the part after the 'end if' is actually just testing garbage.
tried 'move caret' to end of document + 'replace selected text' with the two variables as input.
tried 'select range' then 'move caret'+ 1, then 'replace selected text'.
now I tried that script which is currently in the workflow.
result of all my attempts: the new project name is never inserted and the new task is always inserted at the 2nd character in the existing document.
if 'project' name exists, then everything is fine. new task is added right after the existing project name.
final target is to have a WorkflowIOS workflow trigger this editorial workflow with handing over a section name (=project) and a book title (=task) to this editorial workflow.
if section (i.e. scifi) exists, then add the new book there, if section not exist, then add new section at end of document and add book under it.
THANKS a lot for any help! :)