Show Posts

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.


Messages - Jungle

Pages: 1 2 3 4 [5] 6 7 8 9 ... 24
101
Feature Requests and Suggestions / Multiscript StrSplit improve
« on: December 09, 2022, 14:37:47 »
Now delimiter param in StrSplit function is used as a single separator. It means that the following code will not split input string

Code: [Select]
@var $str = "123,|456;|,789";
@var $arr = StrSplit($str, ";|,");

I request additional optional param like any_char (0/1):
- with the value 0 the function would have current behaviour;
- with the value 1 the character of the delimiter which has the lowest index in the input string would be used as a delimiter (so in the code above it would be "," char)
- with the value 2 the first found char of the delimiter would be used as a delimiter (so in the code above it would be "|" char)

102
Here's updated version with simple CSV parser. Please, don't use in production! :)

Usage example:
 - paste this script into the MultiScript debugger
 - focus your CSV-file on the target panel
 - switch to source panel and select xml-files
 - return to debugger and run

Code: [Select]
# parse csv S&R file
function ParseCSV($file, $separators, $quote_chars)
{
  if ( !(StrLen($separators) == 1) )
  {
    $separators = ",";
  }

  if ( StrLen($quote_chars) == 0 )
  {
    $quote_chars = "\"";
  }

  @var $reg_ex = "^([" + $quote_chars + "])(.*)\\1$";

  @var $lines = LoadArray($file);
  @var $lines_cnt = arrayCount($lines);

  # single-string multiline S&R patterns
  # $pattern[0] - search pattern, $pattern[1] - replace pattern
  @var $pattern[2] = {"", ""};

  @var $i;
  for ($i = 0; $i < $lines_cnt; $i++)
  {
    # $pair[0] - search pattern, $pair[1] - replace pattern
    @var $pair = StrSplit($lines[$i], $separators);

    # invalid line
    if ( !(arrayCount($pair) == 2) )
    {
      continue;
    }

    # append unquoted patterns
    $pattern[0] = $pattern[0] + StrRegExpReplace( $pair[0], $reg_ex, "$2" ) + "\n";
    $pattern[1] = $pattern[1] + StrRegExpReplace( $pair[1], $reg_ex, "$2" ) + "\n";
  }

  return $pattern;
}

###

@var $sar_file    = GetTargetFocusPath();
@var $sar_pattern = ParseCSV($sar_file, ";", "\"`");

if ( ( StrLen($sar_pattern[0]) * StrLen($sar_pattern[1]) ) > 0 )
{
  @var $sel_files = GetSourceSelectedPaths();
  @var $sel_count = arrayCount($sel_files);

  @var $n;
  for($n = 0; $n < $sel_count; $n++)
  {
    @var $file = $sel_files[$n];
    @var $new_file = "*_new.*";

    MC.Utils.FindAndReplace MODE="Many" FIND={$sar_pattern[0]} REPLACEWITH={$sar_pattern[1]} FILE="{$file}" TARGET="{$new_file}" SILENT REPLACEALL OVERWRITE
  }
}

I haven't stress-tested it.

103
Documentation / Re: Missing Documentation - Status
« on: December 08, 2022, 17:26:38 »
StrRegExpReplace description is missing

104
Well, S&R works:

Code: [Select]
@var $sel_files = GetSourceSelectedPaths();
@var $sel_count = arrayCount($sel_files);
@var $find_text = "aaa\\nbbb";
@var $repl_text = "xxx\\nyyy";

@var $n;
for($n = 0; $n < $sel_count; $n++)
{
  @var $file = $sel_files[$n];
#  @var $new_file = PathGetPathPart($file) ^ PathGetNamePart($file, 1) + "_new" + PathGetFileExtPart($file);
  @var $new_file = "*_new.*";

  MC.Utils.FindAndReplace MODE="Many" FIND={$find_text} REPLACEWITH={$repl_text} FILE="{$file}" TARGET="{$new_file}" SILENT REPLACEALL OVERWRITE
}

The full automation requires parsing CSV-file, of course. If its structure is known and "stable", it shouldn't be hard.

UPD. Actually, parsing CSV might be quite hard (in MC).

105
I want to copy some file to the same dir with a new name (manually specified, no autorename). But CopyFile function accepts only path as a target param.

Is it somehow possible to achieve the goal? If no, maybe enhance CopyFile with an additional param or implement a new function CloneFile?

106
I have the following UDC:

Code: [Select]
MC.Utils.FindAndReplace REPLACEALL MODE="Many" FIND="fff\nddd" REPLACEWITH="zzz\naaa" FILE="d:\\temp\\1.txt" TARGET="*_new.*" SILENT OVERWRITE
It works if target file doesn't exist and doesn't work otherwise


UPD. It seems that TARGET param doesn't support direct file names. I.e. if TARGET="d:\\temp\\1_new.txt" it doesn't work. Mask works OK.

107
1. Create new User Defined Command
2. Right click on the QuickLaunch Bar and select "Insert User Defined command"

Result: there's no newly created command in the list. MC restart required

108
Now only Program Path parameter has [R] button to convert path to relative. It woud be great to have the same for Start Folder and Alternative Icon parameters. Actually relative paths are already supported, but it's a bit inconvenient to change Alt. Icon manually via xml-file

109
Support and Feedback / Re: Dragging bug
« on: October 19, 2022, 11:46:58 »
How do you cancel dragging?

Esc or drag over "invalid" region.


110
Support and Feedback / Dragging bug
« on: October 19, 2022, 09:19:20 »
1. Start MC with multiple tabs
2. From the current tab (Tab1) drag a file over inactive tab (Tab2)

Result: Tab2 is activated with blank Explorer panel and drive combo-box

3. Cancel dragging
4. Now press Al+F1/F2 (depending on current panel) and select a drive

Result: New path is set in Tab1, not in current blank Tab2

MC v12.5 b2910 x64 Portable, Win11 Pro Portable

111
Feature Requests and Suggestions / Re: Misc requests
« on: November 11, 2019, 07:50:05 »
Since requests started here...

1. Now when unpacking password-protected 7z-archive with encrypted filenames, MC asks password 3 times. It would be good to see password prompt only once.

2. Now if archive contains sub-archives, MC only goes inside top-level archive. Then it unpacks packed archive and (seems to) redirect it to the system although it is supported by MC. E.g. if there is a zip inside 7z, MC will go into 7z, but zip will be opened in Winows' Explorer. If there's a rar inside 7z, nothing will happen (probably because there is no app associated with *.rar files in my system). So it would be great if MC could go through all sub-archives.

3. External archive profiles.

4. Some kind of status info for a focused file in the List mode.

112
Could you add a screenshot with the place where I need to add it, please?

113
You may create user command, set it to MC.Explorer.Copy and provide it with NODIALOG parameter.

114
Support and Feedback / Re: Copy all files from multiple folders
« on: October 16, 2019, 15:10:11 »
If these folders are inside one parent-folder you may switch to Flat View (Ctrl+Shift+B), select files and launch MultiRename (Menu Extensions > MultiRename).

115
Create user defined command, assign hotkey to it and then add this command to the quicklaunch bar or buttons panel

116
Support and Feedback / Re: How to keep not reachable path
« on: September 24, 2019, 15:03:40 »
Go to Menu Configuration > Explorer Panel Settings, then Display tab, scroll to Save on exit
Try uncheck Remember only paths to local harddrives

117
Support and Feedback / Re: Deleted files don't go to Recycle Bin
« on: September 24, 2019, 08:52:25 »
Quote
Additionally, what's the difference between Remove link target and link to Remove link, not target?

1. Create temporary folder (you may optionally copy some test files there)
2. Create a couple of Junctions (Tools > File Links > Create Links...) to that folder
3. Try delete one of the junctions with Remove link, not target option
4. Try delete other junction with Remove link target and link option

118
Support and Feedback / Re: Wildcards In MultiRename Search and Replace
« on: September 23, 2019, 13:25:50 »
You may use regular expressions, e.g.
Code: [Select]
(\d*)\s(\1)(.*)|$1$3So it would look like on attached screenshot

119
I'm not sure I understand you right, but in MC you can define different applications for viewing, launching and editing. I.e. you may view (F3) *.txt with AkelPad, edit (F4) with PSPad and launch (Enter, Doubleclick) with default windows app.

Or do you mean TC-like behaviour where launch (Enter, Doubleclick) can show pop-up menu with multiple open-with entries?

120
Confirm. The issue exists.

===

There's also issue with [Copy] button in the User defined commands dialog. When I press [Copy] new command is created, but some fields are shown empty. E.g. if source command is "Internal command" then copy will show empty fields "Module" and "Command". If source is "Custom commands" then copy will show empty "Command". In fact they are not empty and after saving will be shown correctly, but it's a bit confusing.

121
Feature Requests and Suggestions / Re: V9.0 IS FINALLY OUT
« on: August 21, 2019, 13:49:22 »
Please implement External Packers support in packer profiles.

P.S. There's minor issue with packer profiles.

1. Add new profile and
2. Immediately remove it

Result: Profile is removed, the first existing is loaded, but its name remains from the removed one, so MC asks to save chaged profile.

122
Support and Feedback / Re: Correct Folder Date/Time No Longer Works
« on: August 03, 2019, 13:31:33 »
Correct folder date/time works for me but only partially. It only applies datetime of the newest file but not folder. E.g. if there is a file with 08.03.2019 12:03 and a folder with 08.03.2019 12:05, then after correcting parent folder will have datetime 08.03.2019 12:03 instead of 08.03.2019 12:05

123
Feature Requests and Suggestions / Re: V9.0 IS FINALLY OUT
« on: July 31, 2019, 18:23:34 »
Another FR.

There're 2 folders: folder1 and folder2. If I rename folder2 to folder1 I'd like contents of folder2 to be moved (asked) to folder1, like Windows does.

124
Feature Requests and Suggestions / Re: V9.0 IS FINALLY OUT
« on: July 29, 2019, 20:57:19 »
It still shows [Release Candidate] in the window caption.
FR: Delete items from operation queues.

125
Support and Feedback / Packing with custom extension issue
« on: June 26, 2019, 13:03:31 »
There's a minor problem. If custom extension is set in pack dialog, no packing occurs. Instead MC creates a folder with new name and copies files there.
E.g. if I set archive name to X:\temp\archive.zzz instead of X:\temp\archive.zip, MC will create X:\temp\archive.zzz\ folder.

Pages: 1 2 3 4 [5] 6 7 8 9 ... 24