Status bar information Scripting access?
-
eil
- Posts: 1903
- Joined: 13 Jan 2011 19:44
Status bar information Scripting access?
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?
HI eil, you can use get("Status"). Take a look at "Status" under SC get in the Help, Scripting Commands Reference. Try running... 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.
Code: Select all
::echo get("Status", 2);-
eil
- Posts: 1903
- Joined: 13 Jan 2011 19:44
Re: Status bar information Scripting access?
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?
Sorry eil, I didn't have time in my earlier post, but this will get the number of items and also the total size:You can obtain $variable = get("Status", 2); first if you'd like and then use it in the two gettoken statements above.
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-
eil
- Posts: 1903
- Joined: 13 Jan 2011 19:44
Re: Status bar information Scripting access?
works like a charm. thanks again 
Win 7 SP1 x64 100% 1366x768|1900x1080
XYplorer Beta Club