[help] [Noob] Difficulty in moving files
[solved] Hi, sorry I guess it's simple file move task, which I am finding difficulty. I have this task, where random image from folder-1 is displayed in scene and then that image gets moved to temporary folder( so that it won't repeat in loop). It's working fine till this point. Once all images are moved, then I want all of the images from temporary folder to move back at once to folder-1 again.
But at action no 13, I am getting error as file not find. I tried array set(separated by comma) and other things. But still I get error as "file not found".
Randomimage2 (288)
A1: List Files [ Directory:All learn/EM/50 drugs in emergency medicine app 1 Match: Include Hidden Files:Off Use Root:Off Sort Select:Alphabetic Variable Array:%files ]
A2: Flash [ Text:%files(#) Long:Off ]
A3: Variable Set [ Name:%max To:%files(#) Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ]
A4: Variable Randomize [ Name:%rand Min:0 Max:%max ]
A5: [X] Variable Set [ Name:%image To:%files Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ]
A6: [X] Show Scene [ Name:Testing Display As:Overlay, Blocking Horizontal Position:100 Vertical Position:100 Animation:System Show Exit Button:On Show Over Keyguard:On Continue Task Immediately:On ]
A7: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
A8: Flash [ Text:%files(%rand) Long:Off ]
<On each run , the image in scene will be moved to temporary folder, so it won't be repeated>
A9: Move [ From:%files(%rand) To:All learn/EM/temporary Use Root:Off Continue Task After Error:On ]
A10: If [ %files(#) eq 0 ]
A11: List Files [ Directory:All learn/EM/temporary Match: Include Hidden Files:Off Use Root:Off Sort Select:Alphabetic Variable Array:%temporary ]
A12: Variable Set [ Name:%tempmove To:%temporary() Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ]
A13: Move [ From:%tempmove To:All learn/EM/50 drugs in emergency medicine app 1 Use Root:Off ]
Posted Feb 10, 2021, 1:19 AM UTC · edited
So I think you are trying to combine two ways of doing this.
Use a for loop to loop through each file in the list files action and move them individually
In the move command, just specify the temp folder in the from and the actual folder in the to fields
Pick 1 and I think you'll be alright.
e.g. in action 13 use the actual temp folder name, not the variable you created in the list files
Hi, thanks for the tip. If I put actual name of temp folder name, then temp folder itself moves to the target folder. It becomes subfolder. I want just files to move.
Because I want the whole process to start again(from action no 1) once ,the scene shows all images.
Then you'll need to do the other method. Create a for loop with variables from start to end of your list files array. Then do a move action for each %tempfile(I)
Hi, I referred to this post. And I followed same steps. Somehow getting error.
old reddit post
I tried test task. Still getting the error.
Move Fil (485) A1: List Files [ Directory:folder 1 Match: Include Hidden Files:Off Use Root:Off Sort Select:Alphabetic Variable Array:%checklist ] A2: Variable Set [ Name:%moving To:%checklist() Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ] A3: Move [ From:%moving To:folder 2 Use Root:Off ]
I think I am doing mistake somewhere as it appears to be very simple task.
Thanks a lot for the other tip of using for loop. I will try that.
Sorry, I am noob. I got it now. At action 12, I am using variable set instead for.
So it's working now?
Yeah, working perfectly. Thanks a lot.
Glad to hear!