Scripting - How to identify branch view

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
nerdweed
Posts: 648
Joined: 25 Feb 2012 07:47

Scripting - How to identify branch view

Post by nerdweed »

How can we identify if the branch view is active.

I am trying to do this
1. In a folder with lots (say 10) folders, I enter a branch view after selecting few (say 5) of them
2. Within those folder, I move files to some other folders
3. I want to delete those folders which the branch view is active on if they don't have any files in them. (most times there wouldn't be any files, but a check would be good).

highend
Posts: 13260
Joined: 06 Feb 2011 00:33

Re: Scripting - How to identify branch view

Post by highend »

mh, use a listpane(, ,2, "<crlf>");
remove the current path + trailing backslash via a regexreplace (escape the path before)
and then a regexmatch / gettoken(..., "count") to see if there are still backslashes in that result?

Adding branch view to get("view"); would ofc be a whole lot easier...
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

admin
Site Admin
Posts: 60288
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Scripting - How to identify branch view

Post by admin »

The /:flat switch is present in a branch view.

Highend, congrats for joining the 3000 club! :appl: :tup:
Attachments
highend3000.png
highend3000.png (1.75 KiB) Viewed 1045 times

nerdweed
Posts: 648
Joined: 25 Feb 2012 07:47

Re: Scripting - How to identify branch view

Post by nerdweed »

Thanks highend and congrats.

Code: Select all

if (!listpane(, , 1, "|"))
		{
			$selitems = listpane(, ,2, "|");
			goto "<curpath>" ;
			delete 1, 1, "$selitems";
		}
Don't know why you asked to remove the current path. This list only the folders that have the branch view enabled (including subfolders). For my needs, I wouldn't be having those sub-folders. Regardless, even if they are and are empty, the delete command would silently ignore it (since they would no longer be present as the parent would have been deleted earlier on).

However; how can I be certain that this is a branch view.

Don,
I thought about reading the /flat from address bar, but didn't a find a way to read what is in the address bar.

highend
Posts: 13260
Joined: 06 Feb 2011 00:33

Re: Scripting - How to identify branch view

Post by highend »

Highend, congrats for joining the 3000 club!
Damn, I'm deleting my last 1000 posts in a sec!
I thought about reading the /flat from address bar, but didn't a find a way to read what is in the address bar.

Code: Select all

text tab("get", "term");
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

nerdweed
Posts: 648
Joined: 25 Feb 2012 07:47

Re: Scripting - How to identify branch view

Post by nerdweed »

Thanks. I never looked it at that way.

Post Reply