Multi Commander Support Forum

Multi Commander => Script => Topic started by: 7mESRq on April 30, 2018, 17:05:02

Title: mark the first 10 Files from the buttom of the Filelist
Post by: 7mESRq on April 30, 2018, 17:05:02
Hi

How can i create a multi script to mark / selected the first 10 Files, start by the buttom of the Filelist ?
It should be using by wildcard or specify extension. E.g. *.txt

by using the script on this forum.

@var $selected_files = GetSourceSelectedFileNames();
MC.Explorer.Selection.Select FILTER={'"' + $selected_files[0] + '"'}

if anyone have suggestion would be helpfull
Thanks
Title: Re: mark the first 10 Files from the buttom of the Filelist
Post by: Mathias (Author) on April 30, 2018, 18:02:40
You should not call a CustomCommand from MultiScript in a loop, since the script engine is run on the same thread as the UI and it might not work all the time

Use MultiScript command
http://multicommander.com/docs/multiscript/functions/getfilefromview#setsourceselected

SetSourceSelected( $arrWithFileNames )

And to get items, maybe you should use  GetSourceItems() , else you get only the selected items.