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.


    Take action on an empty file?

    Editorial
    1
    1
    1443
    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

      In short, I'm trying to set a file's contents based on whether or not the file already exists. If it doesn't exist, I'd like to populate it with a header. If it does exist, I'd like to append information to the file.

      I'm grabbing the contents of the requested filename with Get File Contents, and storing the result in a variable called "oldcontent". I then set up an if/then block to set the file contents if oldcontent is empty (i.e. the filename I requested doesn't exist). In my if/then, I'm leaving the "is Equal to" block blank, but this doesn't seem to work. Is there another way?

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