Taskpaper & add project and task workflow
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:
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! :)
@Beginner101 I hope this helps:
Note that I used a regular expression for searching, so it should work even if the section title appears somewhere else in your document. The section title in the document must end with a colon, but you don't have to include it in the text input dialog.
Hello both of you.
THANKS a lot for your time and input.
Going to use your suggestions to build that workflow I have in mind.