Author Topic: Where is the scripts log file located?  (Read 888 times)

trittico

  • Newbie
  • *
  • Posts: 8
    • View Profile
Where is the scripts log file located?
« on: January 09, 2025, 03:01:32 »
I'm trying to write my first script and to get started I'm just using this:

@var $arr = GetSelectedFileNames();
LogDumpArray($arr);


However I can't find the the log file.
I've checked the log directory (C:\Users\****\AppData\Roaming\MultiCommander\Logs\) and there's nothing there pertaining to my script. There are other, older logs in there.
It's also possible that the script is not running at all. To test that, I tried the above script using a misspelled function name in order to cause an error, and nothing happens. I'm tried running the script from the the quick launch bar and through a hot key. So maybe it isn't running?

Thanks

trittico

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Where is the scripts log file located?
« Reply #1 on: January 09, 2025, 04:55:15 »
OK. I added a messagebox call and the script is definitely executing.

Jungle

  • Contributor
  • VIP Member
  • *****
  • Posts: 560
  • Old Skull
    • View Profile
Re: Where is the scripts log file located?
« Reply #2 on: January 09, 2025, 06:00:49 »
There's MultiScript debugger under the Help menu

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4525
    • View Profile
    • Multi Commander
Re: Where is the scripts log file located?
« Reply #3 on: January 09, 2025, 07:39:52 »
Ctrl+L open the LogWindow of the App. I think LogDumpArray() will output to the Application Log tab there

But use the MultiScript Debugger under the help menu when you writing script. it helps a lot. it is very basic. but you see variables and you step the script row by row
« Last Edit: January 09, 2025, 07:50:36 by Mathias (Author) »

trittico

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Where is the scripts log file located?
« Reply #4 on: January 09, 2025, 13:40:46 »
Thanks! Ctrl-L was the trick

I had actually tried the debugger before but that didn't help me because the output was going to the log, which I couldn't see.

Anyway, thanks all.

trittico

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Where is the scripts log file located? Need some noob advice.
« Reply #5 on: January 09, 2025, 14:06:11 »
ok, now I'm trying to set up the script so that it's stored in an external file, but when I click on configuration->user commands, the screen I get is different than what's in the docs and there is no option to store the script externally. I've attached a screen shot of my user commands screen.

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4525
    • View Profile
    • Multi Commander
Re: Where is the scripts log file located?
« Reply #6 on: January 09, 2025, 14:46:12 »
The doc is a bit out dated.. But all script are stored externally now.

look in
C:\Users\[username]\AppData\Roaming\MultiCommander\Config\Scripts\

<script ID>.udc

You can rename it to something else. just keep the .udc extension..

trittico

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Where is the scripts log file located?
« Reply #7 on: January 09, 2025, 19:18:09 »
Excellent! Thank you!

trittico

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Where is the scripts log file located?
« Reply #8 on: January 10, 2025, 03:18:46 »
The doc is a bit out dated.. But all script are stored externally now.

look in
C:\Users\[username]\AppData\Roaming\MultiCommander\Config\Scripts\

<script ID>.udc

You can rename it to something else. just keep the .udc extension..

So, I found the script file, but I can't get it work smoothly.  By that I mean that editing the file and saving it does not immediately update the script in MC. Does it possibly cache it? Or is there some way to refresh MC so that it re-reads the file?

I've also tried not renaming it but the same thing happens.

I assume that restarting MC would do it.  Haven't tried that but that's not a preferred solution. Copy/pasting from my editor to the MC script editor works, but that's not great either.

For that matter, is there a preferred or recommended way of writing/testing scripts?

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4525
    • View Profile
    • Multi Commander
Re: Where is the scripts log file located?
« Reply #9 on: January 10, 2025, 08:17:31 »
When you say save it ..  do you mean using external editor ? then yes. MC will not reload it automatically.

Use build in editor or the MultiScriptDebugger, it can also save the script.

You often test the script anyway in the Debugger to be able to go step by step to see so everything work..

trittico

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Where is the scripts log file located?
« Reply #10 on: January 10, 2025, 12:38:04 »
OK. Thanks. I should be ok now.

trittico

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Where is the scripts log file located?
« Reply #11 on: January 10, 2025, 20:11:35 »
Thanks to all who helped. I've completed my first script and it's working fine.

I should mention a strange event though. The purpose of the script is to rename selected folders according to some rules. But at some point, the code of my script was replaced by one of the folder names that I had selected! Needless to say, the next time I tried to run the script I got a syntax error.

The udc file was updated also.

Luckily I had a backup, and it hasn't recurred. Yet anyway. Can't figure out how that happened. Pretty strange.