Forum Archive

[Suggestion] Allow variable names in Workflow functions for specifying filenames.

WyldKard

Would it be possible to allow the use of the contents of a variable name for functions like "Set File Contents"? Currently, users have to know the name of the file in advance when creating a Workflow. We can select variables in other portions of Workflow blocks, but not when dealing with files.

omz

When you invoke the copy/paste menu in the filename field, you'll see a "Variable..." item that lets you use a variable as the filename.

WyldKard

Awesome - thanks for pointing that out! I hadn't thought of bringing up the copy/paste menu here to see if that was an option!

WyldKard

Just noticed that you can't mix and match a variable name and manual text. For example, I'd like to prepend the variable value with a filename path, but I can only do one or the other. Could this be added in a future version?

omz

Yes, in single-line text fields, you can only use one or the other (plain text or a variable), it would be relatively difficult to change that due to some implementation details. I'd suggest just using a new variable; you can mix and match plain text with other variables in the Set Variable action.

WyldKard

Got it - I'm setting a new variable by appending my dynamic filename to a default path via a Python script, but good to know I can do it from the Set Variable action block as well. Thanks.

KU

Thanks, that saved my day for the "transfer to Dropbox" problem.