I’m trying to create a task that will move uploaded files out of the sha1 directory into different folder on the BF server. The move logic works fine, but I’m trying to work in parameters and I’m not having much luck. Here’s what I have so far:
action parameter query “folder” with description “Enter full path of destination folder.”
action parameter query “filetypes” with description "Enter identifying characteristic of target files. Ex: LTHOSTNAME, or .log. Wildcards are assumed on both sides of the entry, e.g.
.log
"
//cleanup old files
delete __appendfile
delete movefile.bat
//create bat file
appendfile {concatenation “%0d%0a” of (“move /y %22” & pathname of it & “%22 %22” & {parameter “folder” as string} & “” & name of it & “%22”) of descendants whose (name of it as lowercase contains {parameter “filetypes” as string}) of folder (pathname of parent folder of parent folder of regapp “besadmin.exe” & “\UploadManagerData\BufferDir\sha1”)}
copy __appendfile movefile.bat
//execute bat
waithidden movefile.bat
//cleanup files
delete movefile.bat
delete __appendfile
It fails when creating the batch file, and I’m fairly certain it is because I’m nesting the parameter in the relevance braces, i.e. {relevance {parameter} relevance}. If I replace the inner braces with parenthesis, the job will complete, but the created batch file is blank. I’ve pieced together different suggestions that I’ve seen around the forums, but haven’t been able to get it to work. Any help would be appreciated.
Thanks Ben. I have updated my relevance section to look like this:
appendfile {concatenation “%0d%0a” of (“move /y %22” & pathname of it & “%22 %22” & (parameter “folder” of action as string) & “” & name of it & “%22”) of descendants whose (name of it as lowercase contains (parameter “filetypes” of action as string)) of folder (pathname of parent folder of parent folder of regapp “besadmin.exe” & “\UploadManagerData\BufferDir\sha1”)}
The action now completes, but the .bat file created is still blank. I put this into the relevance debugger on the server, then replaced the parameters with hard values and it produced the expected result, so I think my issue still lies with the parameters. I would be interested to see what you guys have for this type of move already. Maybe I’m spinning my wheels for no reason.
Sorry for the delayed response. I finally had time to revisit this issue today and it works perfectly after adding the ‘as lowercase.’ Thanks as always for the help Ben.