1
Support and Feedback / Re: How to transfer multi-scripts
« on: July 16, 2023, 04:31:15 »
Haven't yet used it much but that looks like just what I was hoping to find out.
Many thanks!
Many thanks!
MultiCommander v14.2 is released!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
@var $suffix = GetTagValue("${param:0}");
@var $message = "Request to Create a Hard Link (Alias)";
$message += "\nParam0=" + $suffix;
if(StrLen($suffix) <= 0)
{
$suffix = "L1";
}
else if (StrLen($suffix) > 5)
{
$suffix = "L9";
}
@var $filename = GetTagValue("${sourcefocusname}");
@var $linkname = StrSub($filename, 0, StrRFind($filename, "."));
@var $linkext = StrTrimLeft($filename, $linkname);
$linkname += "." + $suffix + $linkext;
@var $linkpath = GetTagValue("${targetpath}");
$message += "\nLinkPath=" + $linkpath;
$message += "\nLinkName=" + $linkname;
@var $tofile = GetTagValue("${sourcefocuspath}");
$message += "\nToFile=" + $tofile;
@var $result = MessageBox("Alias Make", $message, 1);
if($result == 1)
{
MC.Utils.CreateLink ASADMIN LNKTYPE=1 LNKTRG=${sourcefocuspath} LNKSRC=${targetpath}\{$linkname}
}
As you can see I'm assuming the parameter value is string (type of data). Because I'm uncertain about this I tried using some of the functions described http://multicommander.com/docs/multiscript/corefunctions but this produced an error in the debugger saying that no such function existed.It depend on what type.. If it us MultiScript you have full control. To get any files you wantMy experience with MC is quite limited but it looks to me like Multiscript invariably adds some capability which is desirable. Therefore, I'm always leaning toward using Multiscript.
If it is CustomCommand.. then you can in the option to check.. (But that only for if files being dropped, else you ned to call a custom command from multiscript. However it depends on what you are doing. The custom Command can interact with the UI and cause issues if you run multiple command in a row without letting it catch up
Take a look here:
http://forum.multicommander.com/forum/index.php/topic,1472.msg5305.html#msg5305
// Script to create a hard link (HL) to the source file (left panel selection),
// the link is placed in the target folder (right panel selection),
// the name of the link is the same as the source file name except for the addition of a suffix
// used to indicate that this directory entry is a hard link. The suffix which can be specified
// by passing a parameter to this script which defaults to "L1" when the script is called without
// using a parameter. This suffix is placed just before the file name extension, which must
// exist, and is preceded by a Period (".") as a separator character.
@var $suffix = "L1";
@var $filepath = GetTagValue("${sourcefocuspath}");
@var $filename = GetTagValue("${sourcefocusname}");
@var $linkdir = GetTagValue("${targetpath}");
@var $linkname = StrSub($filename, 0, StrRFind($filename, "."));
@var $linkext = StrTrimLeft($filename, $linkname);
$linkname += ".";
$linkname += $suffix;
// Full path to link being created
@var $target = $linkdir + $linkname + $linkext;
// Arguments for createlink command to be executed
@var $cmdargs = "ASADMIN LNKTYPE=1 LNKTRG=" + $filepath;
$cmdargs += " LNKSRC=" + $target;
//@var $result = MessageBox("MC.Utils.Createlink", $cmdargs, 0);
MC.Utils.Createlink {$cmdargs};