Skip to content

Iterate/Loop over selected files/folders and use them in terminal #663

Answered by RubicBG
webdevsk asked this question in Q&A
Discussion options

You must be logged in to vote

I don't use Robocopy, someone asked me to help build snippet for him (the logic is not mine)

menu(title='robocopy' mode='multiple' type='file|dir|back.dir') {
	$rc_memory=null
	item(title='Copy Files Only' mode='multiple' type='file' image=icon.copy
		cmd=for(i=0, i<sel.count) {
			if(i==0, rc_memory=null)
			rc_memory = rc_memory + 'robocopy ' + quote(if(sel[i].type==1, path.parent(sel[i]), sel[i])) + ' ' + quote('####') + if(sel[i].type==1, ' ' + quote(path.file.name(sel[i])) )  +  if(i<sel.count-1, ' & ') })
	item(title='Copy' mode='multiple' type='file|dir' image=icon.copy
		cmd=for(i=0, i<sel.count) {
			if(i==0, rc_memory=null)
			// if(i==0, if(keys.shift() and len(rc_memory)>0,  {…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@webdevsk
Comment options

Answer selected by webdevsk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants