I created a Workflow that uses the "Set File Contents" feature. When I call the actual block (from the pre-populated Workflow sets) there's no problem - a file I specify on Dropbox is properly overwritten.
However, in the same workflow I also want to save a file whose name is dynamic - I'm pulling the filename from the contents of another file. As such, I store the filename in a variable, which means I can't use the "Set File Contents" Workflow block, so instead I run a custom Python script and call:
editor.set_file_contents( filepath, action_in.encode('utf8'), 'dropbox')
What happens is if the file doesn't exist, it's created and the contents are set correctly. If the file does exist, however, a new file is created, with the same filename and " (n)" added to the end, where n is a number. So, if I call the workflow three times, I get:
filename.md
filename (1).md
filename (2).md
Is there a reason the file is not being overwritten correctly, or is this a bug?