Save text to file, overwrite every time

I cannot figure this out and it’s breaking my brain.

I’d like to take text in a variable and save it to a file.txt

If the file doesn’t exist, create it.

If it already exists, overwrite it.

The Save action takes only an existing file as input. Append and prepend text to file has no overwrite option. What am I missing?

I’m not sure exactly where your file issue is, but see if this helps.

https://www.icloud.com/shortcuts/9f01e89e22f74b8cb4c6898eb5b6b566

Thank you for your response. I seem to be unable to use the Save file action correctly - like you do?

When I tap on the word ‘File’ in the action, I get presented with a dialog to browse to and select an existing File. I am unable to make use of the output of any action above or any existing variable to serve as the content of the file.

No worries, just found it - have to deselect the ask Where to save option.

:slightly_smiling_face:

1 Like