moudey / Shell

Powerful context menu manager for Windows File Explorer
https://nilesoft.org
MIT License
3.52k stars 120 forks source link

Move/Copy file to predefined location #545

Open aronmgv opened 6 days ago

aronmgv commented 6 days ago

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!

a4d8b3 commented 6 days ago
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.

aronmgv commented 5 days ago

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?

a4d8b3 commented 4 days ago

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'
)
RubicBG commented 4 days ago