Multi Commander Support Forum
Multi Commander => Support and Feedback => Topic started by: macmore on February 18, 2014, 19:05:06
-
How do I create a user defined command that moves the selected file to a particular directory?
-
You need to use UserDefinedCommand of MultiScript type for that.
And then use the MoveFile (http://multicommander.com/docs/multiscript/functions/filesystem#movefile) script command
-
I tried this with and without quotes around the target path, but nothing happens.
MoveFile(c:\backup, ${focusfilepath});
MoveFile("c:\backup", ${focusfilepath});
-
That is because Multi-Script does not support the MultiTags for getting selected files and stuiff, MultiTags are only used for simple script.
MultiScript are powerful but more advanced and works more like real scripts. And you need to check the documentation.
Here (http://multicommander.com/docs/multiscript/functions/getfilefromview) are functions to use to get selected files and stuff.
Something like this (not sure it is correct.. But if you run it via the MultiScript Debugger (under help menu) and you can tweak it )
@var $sourceFile = GetSourceFocusPath();
@var $targetPath = "C:\\Backup\\";
MoveFile( $targetPath, $sourceFile);