Author Topic: mark the first 10 Files from the buttom of the Filelist  (Read 26804 times)

7mESRq

  • Newbie
  • *
  • Posts: 1
    • View Profile
mark the first 10 Files from the buttom of the Filelist
« 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

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4409
    • View Profile
    • Multi Commander
Re: mark the first 10 Files from the buttom of the Filelist
« Reply #1 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.