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 - Ulfhednar

Pages: 1 2 3 [4] 5 6 7 8 ... 21
76
Support and Feedback / Re: MultiCommander v8.9 BETA
« on: May 19, 2019, 13:39:52 »
MC v8.9 b2517 x64 on W10
Hope this is the right place for this...
I've had issues with crashing when running the internal zip command via a scripted button.
This always crashes MC (CTD) - I did send in the bug report incl the script used on a couple of earlier builds but it is still occurring.

Code: [Select]
// get & extract zips
@var $root = GetSourcePath();
@var $arrFiles = FindFiles( $root + "*.zip");
@var $count = arrayCount($arrFiles);
@var $zipFiles = "";
@var $zip;
@var $n1;


// Create ; separated list with all zip files to unpack
for( $n1 = 0; $n1 < $count ; $n1++ )
{
 $zip = $arrFiles[ $n1];
 $zipFiles += $zip;
 $zipFiles += ";";


UnpackFile( $zip, $root, "*.*" , "OVERWRITEALL, USEEXISTINGQUEUE" );
}
MC.RunCmd ID="ExplorerPanel.41075"

The internal zip/rar handling allows me to click through to the contents OK it's just when I call that script.
I am wondering if this is related to MScript as some other scripts that always worked before now sometimes seem to take a while to process.

77
Support and Feedback / Re: Losing Focus When Task Complete
« on: April 04, 2019, 11:34:03 »
OK thanks guys.
I had a sequence of different hardware, different driver builds & variable focus loss on 2 PCs with W10 so I wondered... Navigating away within MC seems to always defeat this loss tho.
Thanks for creating some code to handle this Mathias ;)

78
Support and Feedback / Re: Losing Focus When Task Complete
« on: April 01, 2019, 13:24:05 »
I've had the same problem since win10 1809.
When I have multiple windows open it will pull up the last viewed window, losing MC focus.
I do not need to navigate away during the MC operation, just to move around with MC & other windows running.
e.g. I use the browser then switch to MC, run an op, wait for MC to complete it's task & then browser will pop-up.
BUT If I navigate up/out from the source dir whilst op is running I do not lose focus

I am suspicious of the VGA driver involvement in this as it appears more frequent on some AMD driver versions than on NVDA.  I do not have enough different hardware to test this suspicion fully tho :(

79
Beta Releases / Re: MultiCommander v8.9 BETA
« on: March 11, 2019, 15:05:12 »
---

e05470df6fa74db19ad73aa2c34228ba ? that is a ID of your UserDefinedCommand ?
Then it depends on what that command was using.

Ah ok, I thought the ref # was the command called not the UDC ref #.  I'd previously had 'find files' selected in the dropdown & making a new UDC with that reselected restored that ref #. 
Will see what happens with the new build. ;)

80
Beta Releases / Re: MultiCommander v8.9 BETA
« on: March 08, 2019, 14:55:08 »
Thanks Mathias

I'd originally assigned e05470df6fa74db19ad73aa2c34228ba - that had been working...
I went thru the command selection process again & assigned e05470df6fa74db19ad73aa2c34228ba (again?!) & now it's working OK ::)  so that is just MC giving me a slap in the face I think :D

81
Beta Releases / Re: MultiCommander v8.9 BETA
« on: March 07, 2019, 14:59:02 »
So far so good for me - no CTDs etc.

Ref the search panel - I'd previously assigned it to a toolbar button - that is now broken, has the reference ### changed or...?
The RES# method seems more versatile but I'd like the window to open in the opposite pane as per old behavior or is that switchable via options?

I will keep digging just in case this is me not & MC  :P

Thanks for the continued MC dev work Mathias :)


82
Support and Feedback / Re: Hi all - Hi Matthias!
« on: March 07, 2019, 13:55:36 »
You can set up custom buttons & special define user commands
See
http://multicommander.com/docs/UDC_custom

I use eg -
MC.Explorer.Copy NODIALOG USEEXISTINGQUEUE

& have ones for move & delete

83
Support and Feedback / Re: Saving column layout bug
« on: February 21, 2019, 14:32:59 »
Just wondering if it might be AV related?  Do you see the xml timestamp change when you update it?

I've never had this layout error, but I have had the MDV refuse to keep altered settings without my manually editing the xml.

84
Support and Feedback / Re: On Windows shutdown, session is not saved
« on: February 21, 2019, 14:27:20 »
That is normal, MC doesn't save it's status on a timer or as a temp file etc.
You need to manually save sessions in file>tab sessions or use the last used session config which is saved when MC is normally closed & which auto-loads on MC restarting.

85
Support and Feedback / Re: Back and Forward
« on: December 02, 2018, 00:29:47 »
There are 'history' options.
The 2 dark blue arrow buttons on the left of lowest row of top buttons will navigate the history relative to each tab.
Hi-lite a tab & move about then click these back/forward arrows to retrace the moves, RMB or holding down LMB on an arrow will bring up the history to see/select the travel stops.  There is a full history button next to them (clock).
Parent is accessible via the 'normal' windows folder+green arrow in the top right of each tab, root is \.

Can't recall but you may need to define a custom command to make these things keyboard shortcuts....

86
On W10 I run MC as admin & have made sure it is fully whitelisted to prevent M$ or my AV from interfering with it.
I never see those warnings & everything works.

87
Feature Requests and Suggestions / Re: Skip All?
« on: July 15, 2018, 14:24:53 »
Thanks Mathias ;)

88
Feature Requests and Suggestions / Skip All?
« on: July 13, 2018, 14:53:25 »
Any chance of adding a Skip All button to this dialog?
I was copying/moving files from the Search pane to a folder, some files were duplicated & MC asked each time rather than giving the skip all or other options.

89
Script / Re: Title Case
« on: July 09, 2018, 22:07:04 »
I managed to plagiarize that piece  of code Mathias, I hadn't been sure how/where to insert it but I figured it out :P

Code: [Select]
@var $arr = GetSourceSelectedPaths();
@var $NameA = PathGetNamePart( $arr );
@var $newText = TitleCase($NameA);
@var $NameB = $newText[0] = StrToUpper( $newText[0] );

{
RenameFile( $arr, $newText, "RENAME_RO" );
}

Thanks again. ;)

BTW do you use any specific syntax coloring to help when when coding with MS?  I find it helps me if I can use colors when I'm trying something.  ATM I am using notepad++.  Any recommendations for coloring?   (It's probably a big job but maybe you can add syntax coloring to the MS Debugger some time....?)

90
Script / Re: Title Case
« on: July 08, 2018, 22:30:57 »
Thanks Mathias.  I appreciate the help. :)

My solution was more verbose.  My primary focus was to get a working version.  Now I can use this as a reference whilst I am playing about trying to tweak & tidy my code.
I had looked at the
Code: [Select]
$textPart[0] = StrToUpper( $textPart[0] );entry & was going to try it, but decided that I would probably create a conflict/problem.    ::)
So I went with what I knew would work with this task as a logical progression/last check on the first word case status. :P
I'd also wondered about adding a line equating to something like "ignore exceptions array if word starts with/at character 0" within your function.

I intend to come back to your function code as I need to understand how you have used scope & therefore how to use that $textPart[0] to check first word capitalization as the last operation before generating $NewText..

I think I understand about $n, that is interesting & raises more questions for me. I'm glad you have shown me that this can happen or I am sure I would have been driven crazy had I accidentally discovered it alone :)   

91
Script / Re: Title Case
« on: July 08, 2018, 14:59:16 »

Sorry,. I don't understand your reasoning how that should work, it make no logical sense :)
I know!  :D

Thanks to your input, I realized I hadn't assigned iterations & needed more references for the arrays & got it to work - I am still finding it hard to balance how smart code can appear with how dumb the machine really is  :P

Code: [Select]
@var $exceptionsArray[] = { "a", "as", "an", "and", "any", "at", "for", "from", "into", "is", "of", "on", "or", "the", "to", };
@var $n;
@var $oldN;

function TitleCase($name)
{
   return  _TitleCase($name, " ");
}

function _TitleCase($name , $splitchar)
{

  @var $result = "";
  @var $parts = StrSplit($name , $splitchar); // space and - will split string
 
  @var $cnt = arrayCount( $parts );
  for( $n = 0; $n < $cnt ; $n++ )
  {
    @var $textPart = $parts[ $n ];
    // To Lower
    $textPart = StrToLower( $textPart );
 
    if( StrFind( $textPart , "-", 0 ) > 0)
    {
      // Becuse of recursive bug, $n is is overwriten
      $oldN = $n;
      $textPart = _TitleCase($textPart , "-");
      $n = $oldN;
    }

    if( arrayFind( $exceptionsArray, $textPart ) == -1)
    {
    // Uppser case on first
    $textPart[0] = StrToUpper( $textPart[0] );
    }

    if( StrLen( $result ) > 0 )
$result += $splitchar;

    $result += $textPart;
  }
  return $result;
}
 

@var $arr1 = GetSourceSelectedPaths();
@var $items = arrayCount($arr1);
@var $CurrentNameFullPath;
@var $OrgName;
@var $NewName;
@var $n1;


for( $n1 = 0; $n1 < $items; $n1++ )
{
 
@var $arr = GetSourceSelectedPaths();
@var $NameA = PathGetNamePart( $arr[$n1] );
@var $newText = TitleCase($NameA);



  $CurrentNameFullPath = $arr1[ $n1 ];
  $OrgName = PathGetNamePart( $CurrentNameFullPath );
  $NewName = StrReplace( $OrgName, $NameA, $newText );
 
RenameFile( $CurrentNameFullPath, $NewName, "RENAME_RO" );
}

I obviously haven't made it as clean as it might be, but it is a start. 
Think I have abused the { } .  ::)

I am now wondering about capitalizing the first word where the first word is in the exceptions list e.g.
For MultiScript coding disasters this is the place
becomes
for Multiscript Coding Disasters This is the Place

I may need to plagiarize some of that function you created...  ;)

UPDATE
Added this
Code: [Select]
@var $char1 = StrSub($NewName, 0, 1);
@var $char2 = StrToUpper( $char1 );
@var $NameB = StrReplace( $NewName, $char1, $char2 );
 
RenameFile( $CurrentNameFullPath, $NameB, "RENAME_RO" );

so now the emergency is over, I can go to sleep :D :P



........I also wondered about the recursive bug $n/$oldN is that something that only manifests in this type of function?

92
Script / Re: Title Case
« on: July 07, 2018, 17:51:57 »
OK I'm incorrectly thinking that because
Code: [Select]
for( $n = 0; $n < $items; $n++ )works for multiple files - it will call the same thing ($arr) in 2 different ways --- which it won't  :o

I need to differentiate...  Thank you Mathias, I will try again & stop destroying your weekend now !   :D

93
Script / Re: Title Case
« on: July 07, 2018, 16:08:20 »
Thanks for the advice & info Mathias.
This is how I employed your function & it works well. I can see that it will be straightforward to expand on this for a number of other operations so I might actually learn how to use MS properly one day  :P ;)  It has (again) impressed on me that it is quite different from my school experience of Basic, this system feels like it contains a lot of macros in comparison.

Code: [Select]
@var $exceptionsArray[] = { "a", "an", "and", "any", "at", "for", "from", "into", "of", "on", "or", "the", "to", };

function TitleCase($name)
{
   return  _TitleCase($name, " ");
}

function _TitleCase($name , $splitchar)
{

  @var $result = "";
  @var $parts = StrSplit($name , $splitchar); // space and - will split string
 
  @var $cnt = arrayCount( $parts );
  for( $n = 0; $n < $cnt ; $n++ )
  {
    @var $textPart = $parts[ $n ];
    // To Lower
    $textPart = StrToLower( $textPart );
 
    if( StrFind( $textPart , "-", 0 ) > 0)
    {
      // Becuse of recursive bug, $n is is overwriten
      $oldN = $n;
      $textPart = _TitleCase($textPart , "-");
      $n = $oldN;
    }

    if( arrayFind( $exceptionsArray, $textPart ) == -1)
    {
    // Uppser case on first
    $textPart[0] = StrToUpper( $textPart[0] );
    }

    if( StrLen( $result ) > 0 )
$result += $splitchar;

    $result += $textPart;
  }
  return $result;
}

 
@var $arr = GetSourceSelectedPaths();
@var $items = arrayCount($arr);
@var $NameA = PathGetNamePart( $arr );
@var $newText = TitleCase($NameA);
@var $i = 0;


for( $i = 0; $i < $items; $i++ )


{
RenameFile( $arr, $newText, "RENAME_RO" );
}


EDIT
If I select multiple files it only runs on the first file... is this the recurse bug or is my recurse instruction bad... thought I had that one OK  :-\ ???

94
Script / Re: Title Case
« on: July 06, 2018, 18:31:42 »
Thanks very much Mathias.  ;D  8)
I didn't realize I could use this array form in MS -
Code: [Select]
@var $exceptionsArray[] = { "a", "an", "and", "any", "at", "from", "into", "of", "on", "or", "the", "to", };
The function you have provided is very helpful in making me see the break-down of events & how MS can be used to run different tasks.  I will have to study/learn your style. 

Also I think I may have under-estimated MS & that that combined with my inexperience with ('modern') programming, causes trouble.
I have been looking at Java & C++ so I recognize these structures of code - just not well enough...! 
Better go & read those books I bought I guess ;)

OT Is it possible to create a StrRegExpReplace function for MS?  Or better to combine functions that are already there? 
I liked the idea of using StrRegExpFind to enumerate $<instance> & StrRegExpReplace to step through & replace each $<instance>.  Maybe that couldn't work in practice tho?

95
Script / Re: Title Case
« on: July 06, 2018, 13:34:17 »
Thanks for the replies.  :)

I am using StrToUpper and StrSub .  The trouble probably is my finding the right approach.

This was a way I'd looked at word capitalization, but a regex gives me all the instances quicker.
Code: [Select]
...
@var $arrN = StrSplit( $NameA, " ");
@var $Words = $arrN[1];
@var $Char1 = StrSub($Words, 0, 1);
@var $arrN1 = StrToUpper($Char1);
...

Via regex I can have the number of instances output, hence my search for a regex replace function.
Using StrRegExpFind & a simple \s[a-z] gives me all the lower case words, I should in theory be able to take each instance ($1 $2 etc) & handle it with the StrToUpper - but that doesn't seem to be possible (tho it may be just me not getting the <str> &/or <arr> code right!) so I wondered if there might be a StrRegExpReplace function... 
Can I pass the instances found by StrRegExpFind to the StrToUpper  function?  :-\ 

The exception list should be straight forward enough - I can just run them one by one, would be nice if I could pass the exception array as in the C# above tho!   The C# seems to require a lot less steps to achieve the result.

My plan was
  • acquire the selected file name(s)
  • select the words ignoring 1st word
  • all words to lower case
  • capitalize all words
  • find words in the exception list & make them lower case
  • write the new title case string to the filename.

I don't know if I'm misunderstanding you Mathias ref  - ToTitleCase - could just be how the author has labelled the process the code invokes & displays on the GUI as opposed to a specific C# function....?

The idea was to take a title eg
ANT-MAN AND THE WASP  | ant-man and the wasp | Ant-Man And The Wasp
& convert it to Title Case = Ant-Man and the Wasp
(Altho I think in this case it may need to be Ant-Man and The Wasp...  ::) :P)

This process obviously applies to many titles where simply using Camel-Case doesn't look pretty/over-emphasizes secondary prepositions etc.
I liked the idea so thought it might be fun (!) to try to recall how to script with MS   ::)  ;D


96
Script / Title Case
« on: July 05, 2018, 20:24:16 »
I saw this the other day
Code: [Select]
using System;
using System.Collections.Generic;

public static class ClipboardFusionHelper
{
    public static string ProcessText(string text)
    {
        //Words that will not be capitalized; add words to this list as required
        string[] exceptionsArray = { "a", "an", "and", "any", "at", "from", "into", "of", "on", "or", "the", "to", };
     
        List<string> exceptions = new List<string>(exceptionsArray);
     
        //Break the input text into a list of capitalized (not upper case) words
        text = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(text.ToLower());
        List<string> words = new List<string>(text.Split(new char[] { ' ' }));

        //Always leave the first word capitalized, regardless of what it is
        text = words[0];
        words.RemoveAt(0);
       
        //Check each remaining word against the list, and append it to the new text
        foreach (string s in words)
        {
            if (exceptions.Contains(s.ToLower()))
               text += " " + s.ToLower();   
            else
               text += " " + s;
        }

        return text;
    }
}

I thought I'd like to translate it to MS & add it to a button.

I can grab & split a filename, I can see how I could use the str selection to alter the words I want in lower case to lower case ... but I'm wondering if I need something like a regex version of
Code: [Select]
<str> StrReplace(<str> input, <str> find, <str> with );
Maybe I just haven't figured out the ordering of commands to modify the arrays yet but I'd really like something that would give me a [a-z] -> [A-Z] function :P

Any advice Mathias?

97
daveme7  If you are referring to the options dialogs, you can use a 'user command' to remove that (config > user defined commands) as Mathias says.
I use -
MC.Explorer.Move NODIALOG USEEXISTINGQUEUE
which I have added to the buttons at the bottom.
This will move all selected items between panes without dialogs or confirmations.  The NODIALOG switch works on other things such as delete as well.

98
Feature Requests and Suggestions / Re: Batch renaming function
« on: June 18, 2018, 13:16:14 »
Looks cool.. I just wish I had there time and budget too :)
But some of it might be possible.

When I win the Lottery I'll get back to you Mathias   ;D

99
Tips and Tricks / Re: CMD console mod (Freeware)
« on: June 17, 2018, 16:10:51 »
ConEmu looks interesting, does more than I need at the moment but am going to play around with it a bit :)

Yes MC is superior to Q-Dir, the latter is only regular explorer made more usable & so won't be taking the MC crown I think :D

I've decided I like the AutoHideDesktopIcons & GetWindowText tools from the softwareOK.

100
Feature Requests and Suggestions / Batch renaming function
« on: June 16, 2018, 11:58:02 »
Until MC, Directory Opus was my favorite file manager in terms of style & features.
I saw their 'Whats new' vid the other day & the way DO now handles batch renaming seems like a nice feature. 
https://youtu.be/ircl1OVEdaM?t=81
This is a 'bells & whistles' feature perhaps, & MC allows a lot of options with MR but I wondered how difficult it would be to add something similar in MR.... :-\ :)


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