omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    [Bug] "Set File Contents" not overwriting file in Dropbox.

    Editorial
    3
    4
    2655
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • WyldKard
      WyldKard last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • omz
        omz last edited by

        This seems to be a bug. However, as I've mentioned here, you can use a variable in the filename field of the Set File Contents action.

        1 Reply Last reply Reply Quote 0
        • WyldKard
          WyldKard last edited by

          Great - I'll modify my workflow to use the block then instead of setting file contents from a script, until this gets fixed. Thanks for the quick reply!

          1 Reply Last reply Reply Quote 0
          • bevesce
            bevesce last edited by

            Hi,
            will this bug be fixed somewhere in the near future?

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB Forums | Contributors