Skip to content

Instantly share code, notes, and snippets.

View tablacus's full-sized avatar

Gaku tablacus

View GitHub Profile
@tablacus
tablacus / RenameCurrentFolder.js
Last active February 26, 2024 07:27
Reane current folder -Tablacus Explorer
const FolderItem = FV.FolderItem;
if (api.GetAttributesOf(FolderItem, SFGAO_CANRENAME)) {
const s = api.GetDisplayNameOf(FolderItem, SHGDN_FOREDITING | SHGDN_INFOLDER);
InputDialog(FolderItem.Path, s, function (r) {
if (/[\\\/:,;\*\?"<>\|]/.test(r)) {
MessageBox(api.LoadString(hShell32, 4109), null, MB_ICONSTOP | MB_OK);
return;
}
if ("string" === typeof r && s != r) {
try {
@tablacus
tablacus / downtotop.js
Created November 20, 2023 13:26
On the details screen, use the down key on the bottom item to move to the top item - Tablacus Explorer
if (Ctrl.GetFocusedItem < Ctrl.ItemCount(SVGIO_ALLVIEW) - 1) {
return false;
}
wsh.SendKeys("{HOME}");
@tablacus
tablacus / uptoend.js
Created November 20, 2023 13:23
On the details screen, use the up key on the top item to move to the bottom item. - Tablacus Explorer
if (Ctrl.GetFocusedItem) {
return false;
}
wsh.SendKeys("{END}");
@tablacus
tablacus / controlpanelmenu.js
Created June 16, 2023 09:44
Control panel menu - Tablacus Explorer
const pt = api.GetCursorPos();
FolderMenu.Open(WINVER >= 0x600 ? "::{26EE0668-A00A-44D7-9371-BEB064C98683}" : ssfCONTROLS, pt.x, pt.y, "*", 1, null, null, function (FolderItem) {
if (FolderItem) {
FolderMenu.Invoke(FolderItem);
}
});
@tablacus
tablacus / copy_tabs.js
Created April 20, 2023 11:28
Copy tabs to next pane (Add-on "Switch to next pane" is required) - Tablacus Explorer
const TC = FV.Parent;
for (let i = 0; i < TC.length; i++) {
NavigateFV(Sync.SwitchPane.NextFV(TC[i]), TC[i].History, SBSP_NEWBROWSER);
}
@tablacus
tablacus / refreshandapply.js
Created October 20, 2022 22:29
Refresh and apply folder setings - Tablacus Explorer
const FV = GetFolderView(Ctrl, pt);
FV.Refresh()
const item = Sync.FolderSettings.Get(FV);
if (item) {
const s = item.text || item.textContent;
if (s) {
Exec(FV, s, item.getAttribute("Type"), null);
}
}
@tablacus
tablacus / newfolder.js
Last active September 22, 2022 07:52
New Folder dialog - Tablacus Explorer
const currentPath = api.GetDisplayNameOf(FV, SHGDN_FORPARSING);
InputDialog("New Folder", "", function (r) {
if (r) {
let path = r.replace(/^\s+/, "");
if (!/^[A-Z]:\\|^\\/i.test(path)) {
path = BuildPath(currentPath, path);
}
fso.CreateFolder(path);
}
});
@tablacus
tablacus / toggle_fullscreen.js
Created February 5, 2022 14:53
Toggle fullscreen - Tablacus Explorer
ToggleFullscreen();
@tablacus
tablacus / copyaspath.js
Created January 11, 2022 22:44
Copy as path - Tablacus Explorer
clipboardData.setData("text", (FV.FocusedItem || FV.FolderItem).Path);
@tablacus
tablacus / toggle_seletion.js
Created December 28, 2021 14:14
Toggles the selection of focused item - Tablacus Explorer
const nFocused = FV.GetFocusedItem;
const bSelected = api.SendMessage(FV.hwndList, LVM_GETITEMSTATE, nFocused, LVIS_SELECTED);
FV.SelectItem(nFocused, bSelected ? SVSI_DESELECT : SVSI_SELECT);