Status bar information Scripting access?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
eil
Posts: 1903
Joined: 13 Jan 2011 19:44

Status bar information Scripting access?

Post by eil »

is there a way to get info shown in status bar of XY? for ex i selected some files and want to save in var the size and number of items. status bar displays this info much faster than implementing smt in script to get same numbers.
Win 7 SP1 x64 100% 1366x768|1900x1080

klownboy
Posts: 4477
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: Status bar information Scripting access?

Post by klownboy »

HI eil, you can use get("Status"). Take a look at "Status" under SC get in the Help, Scripting Commands Reference. Try running...

Code: Select all

::echo get("Status", 2);
in the Address Bar after you have hi-lighted some files. $variable = get("Status", 2); From that point, you'll have to use either SC gettoken or regEx to obtain the specific info you need.

eil
Posts: 1903
Joined: 13 Jan 2011 19:44

Re: Status bar information Scripting access?

Post by eil »

thanks for hint, will look into it.
Win 7 SP1 x64 100% 1366x768|1900x1080

klownboy
Posts: 4477
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: Status bar information Scripting access?

Post by klownboy »

Sorry eil, I didn't have time in my earlier post, but this will get the number of items and also the total size:

Code: Select all

  $number = gettoken(get("Status", 2), 1, " "); echo $number;                         // number of files and folders
  $size = gettoken(gettoken(get("Status", 2), 2, ":","t"), 1,"(", "t"); echo $size;   // the size in KB/MB
You can obtain $variable = get("Status", 2); first if you'd like and then use it in the two gettoken statements above.

eil
Posts: 1903
Joined: 13 Jan 2011 19:44

Re: Status bar information Scripting access?

Post by eil »

works like a charm. thanks again :tup:
Win 7 SP1 x64 100% 1366x768|1900x1080

Post Reply