Action Parameter Query & Appendfile

Hello!

I am trying to append a file with a line of text. The line of text will include input from the user who executes the fixlet.

Here is what I have, but it’s failing at appendfile:

// Prompt for Download Attempts
action parameter query “Download” with description “Enter number for download retries. Ex: For 10 tries, enter 10.”

// set parameter to file name and path
parameter “filename” = “C:\test.txt”

// add new text to end of file
appendfile {concatenation “%0d%0a” of lines of file (parameter “filename”) & “%0d%0a” & “DownloadPerFile={parameter “Download” of action}”}

// backup original file (delete any old backups first)
delete "{parameter “filename”}.bak"
move “{parameter “filename”}” “{parameter “filename”}.bak”

// replace file
copy __appendfile “{parameter “filename”}”

Part of the problem appears to be that the parameter “Download” of action is surrounded by curly braces within the appendfile line. Perhaps something like this (I’m not entirely sure what you want the line to look like):

appendfile {concatenation "%0d%0a" of lines of file (parameter "filename") & "%0d%0a" & "DownloadPerFile=" & (parameter "Download" of action)}

1 Like

Thank you! That worked perfectly!