Rename tabs to first 9 characters
Rename tabs to first 9 characters
is it possible to rename tabs to a variable like the first 9 characters of a folder?
Re: Rename tabs to first 9 characters
Code: Select all
//Rename tabs to first 9 characters of folder
$tabs = get("tabs", "|");
foreach($tab, $tabs, "|") {
$count++;
$path = tab("get", "path", $count);
$base = gpc($path, "base");
$newCapation = substr($base, 0, 9);
tab("rename", $newCapation, $count);
}
Win10, Win11 @100% 2560x1440 22H2
Re: Rename tabs to first 9 characters
Norn that's incredible thank you very much.
One annoying request is can the tab somehow update automatically when changing directory? I notice the tab just has a text field, I tried to have it load a script but I couldn't get it to work.
I would be so grateful to get this working.
One annoying request is can the tab somehow update automatically when changing directory? I notice the tab just has a text field, I tried to have it load a script but I couldn't get it to work.
I would be so grateful to get this working.
Re: Rename tabs to first 9 characters
tab("rename", substr(gpc(tab("get", "path"), "base"), 0, 9));
and use it as a script for: configuration - custom event actions => after painting the file list?
One of my scripts helped you out? Please donate via Paypal
Re: Rename tabs to first 9 characters
Thank you highend I love this community so much.
Is it possible to exclude some tabs somehow or only apply the script to the first two tabs on a given pane? It's always the same tabs they are locked and don't move only on the first pane.
Is it possible to exclude some tabs somehow or only apply the script to the first two tabs on a given pane? It's always the same tabs they are locked and don't move only on the first pane.
Re: Rename tabs to first 9 characters
Code: Select all
if (regexmatches(tab("get", "id"), "^(1|2)$")) {
tab("rename", substr(gpc(tab("get", "path"), "base"), 0, 9));
}
One of my scripts helped you out? Please donate via Paypal
Re: Rename tabs to first 9 characters
Highend, you are impressive.
Thank you very much, works perfectly
Thank you very much, works perfectly
Re: Rename tabs to first 9 characters
That should be extendable with "special" handling for tabs you might want to name individually, right?highend wrote: ↑12 Aug 2022 07:45?Code: Select all
if (regexmatches(tab("get", "id"), "^(1|2)$")) { tab("rename", substr(gpc(tab("get", "path"), "base"), 0, 9)); }
That's not a request for another update of your code, though... If I need another if...then...else I'm sure, that's done easily enough if I take the time to dive into the scripting guide...