Shell icon indicating copy to clipboard operation
Shell copied to clipboard

Move/Copy file to predefined location

Open aronmgv opened this issue 1 year ago • 3 comments

Hello.

I want to achieve a context menu section which will be named e.g. CONVERT and it will have submenu which will do a "move" of a file/s to predefined folders:

image

Is it possible please? Thanks!

aronmgv avatar Oct 25 '24 09:10 aronmgv

menu (title='Convert' type='file' mode='multiple')
{
    item(title='Folder A' cmd=io.move(sel.path,path.join('Your Directory',sel.name))  invoke=1)
    item(title='Folder A' cmd=io.move(sel.path,path.join('Your Directory',sel.name))  invoke=1)
    item(title='Folder A' cmd=io.move(sel.path,path.join('Your Directory',sel.name))  invoke=1)
}

This will move all the selected files to the specified path. replace 'Your Directory' with the actual path.

ghost avatar Oct 26 '24 04:10 ghost

Hey. Thanks for the reply, it works! However I dont see the explorer moving dialog.. It just moves somewhat in the background and the file disappears.. is there a "explorer" function to move files? So it triggers the moving dialog?

aronmgv avatar Oct 26 '24 21:10 aronmgv

No idea about native functions. you could give powershell a shot, but that would have its own quirks:

item (
    title="Folder A"
    cmd-ps=`$t=New-Object -ComObject 'Shell.Application';($t.Namespace('Your dir here')).movehere('@sel.path')`
    window='hidden'
    invoke=1
    mode='multiple'
)

ghost avatar Oct 27 '24 09:10 ghost

  • some notification can be added at the end where it takes time to complete the operation (for example when moving from c:\ to d:)
  • a ps command can be added to show the Progress Bar when moving, but the ps panel must be visible

RubicBG avatar Oct 27 '24 11:10 RubicBG