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.


Topics - ajax

Pages: [1]
1
Script / Is it possible to append text to a file?
« on: April 13, 2020, 17:47:12 »
I can use the echo command to append text to a file but thought such a script would be cleaner if I could do it using something like the "SaveStringToFile" command.  However, it seems "SaveStringToFile" does NOT allow text to be appended to a file.  This seems like a very normal/natural thing to do.  Given how sophisticated the Multicommander scripting capability is it would be surprising to find this can NOT be done.

I'm thinking that first using "LoadStringFromFile" and then appending to that string before running "SaveStringToFile" might work but this could become unwieldy as the size of the file grows and I'd opt to stick with echo.

I hoping someone can clue me in about what I've failed to figure out.

2
I'm a bit of a newbie with respect to MC.  Very much want to use dual panel capability to run scripts on folders/files located in one part of the file system that affect other parts of the file system.  In that, make selections in one pane (? source) and operate on selections in the other pane (? target).  With some difficulty I have been successful writing some such scripts but have now discovered that making source and target selections is something I have yet to figure how to do.

Have spent a good bit of time in the Online Documentation which I'd generally say is very impressive but have yet to find anything describing the notion of dual panels and how they relate to each other.  I'm guessing that this has something to do with the commonly used but, as best I've been able to find, undefined meaning of the terms "source" and "target".

Would be grateful if someone could either refer me to what I haven't been able to find or possibly offer a precise definition of what these terms mean with respect to MC.

3
Script / Possible bug in Function StrTrimLeft()
« on: July 08, 2018, 20:34:07 »
It looks like there may be a bug in function (StrTrimLeft) which I'm using to separate the file name extension from the remaining part of the file name.  For whatever it is worth the files I'm working with are images and a typical extension is .jpg.  I'm using the StrRFind function to locate the right most period (".") in the filename.  Then StrSub to obtain the portion of the filename that includes everything up to the period.  This all works as expected.

However, when I then use StrTrimLeft to obtain just the file name extension I get different results depending on how the filename is composed.  In my case, whenever the filename has only one period (".") that separates the extension from the rest of the filename I get the expected result.  For example, if the filename is "PartA.jpg" I get the extension as ".jpg".  However, if the file name where "PartA.PartB.jpg" I get the extension as "jpg".  In that, an extra period (".") character is being trimmed.  The same, incorrect result, seems to occur whenever the filename contains more than one period (".").

Following are a couple of lines of code that experience the problem -

@var $linkname = StrSub($filename, 0, StrRFind($filename, "."));
@var $linkext = StrTrimLeft($filename, $linkname);

4
Script / How to run script on multiple files?
« on: July 04, 2018, 22:32:12 »
Is it possible to execute a script all of the files in a selection list?  If so how?

5
Still trying to do what provoked a previous post (http://forum.multicommander.com/forum/index.php/topic,2212.0.html) but am past the documentation stage.  The MultiScript debugger does some nice things but even using it success is quite illusive.  Here are some suggestions which I think would make the debugger much more useful.

  • Need to be able to copy text from the panel that displays values, that the variables get set to, which can then be pasted elsewhere.
  • Before executing one of the MC.xxx commands that command needs to be expanded (i.e., variable substitution completed) and then displayed prior to being executed.

Based on inspection of variable values my scripts work correctly but something bad is happening when MC.xxx commands are invoked.

A minor suggestion would be to add a horizontal scroll bar to the panel used for outputting debugger results.  Even on my wide screen display the values are often out of view.

6
The significant capability of Multi Commander that captured my interest is the ability to create and use user defined commands/scripts.  Thought I was doing pretty good on my first one until trying to run it and finding that it failed.

I was able to find the log files which contained error codes but absent some explanation of what they mean they are pretty useless.  Is there a reference that would solve such problem?

Likewise, the procedure for creating a "Custom Command" is nicely documented but lacking some necessary details.  It appears as though my intuitive attempt to specify function arguments must have gotten it wrong.  A bit a trial and error hacking didn't overcome the problem.  Some elaboration on the meaning of these parameters also seems necessary for this to be an effective tool.

While the documentation for Multi Commander overall appears to be very nice the shortcomings mentioned above happen to be critical to my finding the use of Multi Commander to be worthwhile.

Pages: [1]