Author Topic: Command to Move File  (Read 13777 times)

macmore

  • Junior Member
  • **
  • Posts: 20
    • View Profile
Command to Move File
« on: February 18, 2014, 19:05:06 »
How do I create a user defined command that moves the selected file to a particular directory?

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4450
    • View Profile
    • Multi Commander
Re: Command to Move File
« Reply #1 on: February 18, 2014, 19:47:50 »
You need to use UserDefinedCommand of MultiScript type for that.

And then use the MoveFile script command


macmore

  • Junior Member
  • **
  • Posts: 20
    • View Profile
Re: Command to Move File
« Reply #2 on: February 18, 2014, 21:52:05 »
I tried this with and without quotes around the target path, but nothing happens.

MoveFile(c:\backup, ${focusfilepath});

MoveFile("c:\backup", ${focusfilepath});

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4450
    • View Profile
    • Multi Commander
Re: Command to Move File
« Reply #3 on: February 18, 2014, 22:07:31 »
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 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 )
Code: [Select]
@var $sourceFile = GetSourceFocusPath();
@var $targetPath = "C:\\Backup\\";
MoveFile( $targetPath, $sourceFile);