Jump to content
student

[SOLVED] Add content to a file

Recommended Posts

Hei!

I was hoping for an advice on a workflow I got hold of.

Supposedly, the workflow should create a new note and fill in structure of the note.

For some reason, it creates the the file and fills inn the correct UID of the file, but I can’t get it to fill in the note structure (Various text).

The structure is there in the blank field of the "write text to file" object, but it doesn't fill it into the new note.

Does anyone have an advice to what I am missing? (Im not a computer geek, but I try to understand).

 

 

 

Best regards

Student

Skjermbilde 2019-09-26 kl. 19.18.47.png

Edited by student

Share this post


Link to post

Welcome @student,

 

When asking for help with a Workflow, please upload it somewhere as we can’t properly help you without access to it. Debugging can already be hard with access to the code, and you’re asking us to guess yours from a description. There are multiple places where your code or Workflow setup may be going wrong. Without looking at it we’re shooting in the dark.


Read the Reporting Problems with Workflows topic, as it gives a nice overview on how to build an effective report.

Share this post


Link to post

I can’t reproduce; everything works fine for me. Are you certain ~/Dropbox/zettelkasten/ is correct, and that there isn’t a typo?

Share this post


Link to post

Hei,

 

The path in my case is: ~/Users/myname/Documents/Notes (The Archive){var:ymd} {var:title}.txt  (myname being my user).

 

Activating the shortcut for the workflow prompts me correctly with "new zettel", I type in the title, the archive opens the created note like this: 

1379070770_Skjermbilde2019-09-28kl_19_42_35.thumb.png.3e51b9af937f09fc2de3599f9a22d0f2.png

 

Then I (have to) press enter and the note is created without the content in the "write to file" object.

How weird that it is working for you..😶

 

Well..thx for trying anyway! 

 

 

 

Share this post


Link to post

Hmm...this was interesting...when I ran it I saw an error in the "write text file", wrong path.

Now I changed the path and everything seems fine according to the debugger. Still it doesn't write any text to the file..

The path in my config is now: ~/Documents/Notes (The Archive){var:ymd} {var:title}.txt

 

 

[22:20:39.499] zettelkasten[Keyword] Processing complete
[22:20:39.500] zettelkasten[Keyword] Passing output '- new note' to Arg and Vars
[22:20:39.501] zettelkasten[Arg and Vars] Processing complete
[22:20:39.502] zettelkasten[Arg and Vars] Passing output '- new note' to Write Text File
[22:20:39.502] zettelkasten[Write Text File] Processing complete
[22:20:39.503] zettelkasten[Write Text File] Passing output '/Users/myname/Documents/Notes (The Archive)201909282220 - new note.txt' to Delay
[22:20:41.497] zettelkasten[Delay] Processing complete
[22:20:41.501] zettelkasten[Delay] Passing output '/Users/myname/Documents/Notes (The Archive)201909282220 - new note.txt' to Open URL
[22:20:41.537] zettelkasten[Open URL] Processing complete
[22:20:41.538] zettelkasten[Open URL] Passing output 'thearchive://match/201909282220%20-%20new%20note' to Post Notification

 

 

 

 

Share this post


Link to post

When I put in: /Users/XXXX/Documents/Notes (The Archive) {var:ymd} {var:title}.txt

 

Then the workflow creates an txt file with the content that I add in the script, but outside the "notes (The Archive) folder. No errors given in the debugger, and the Archive opens and prompts me with the generated filename, pressing enter saves a blank txt file in the archive folder. Weird.  

Share this post


Link to post
24 minutes ago, student said:

Then the workflow creates an txt file with the content that I add in the script, but outside the "notes (The Archive) folder.

 

Well, yeah. There's no slash between your folder name and your file name.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...