Skip to content

Instantly share code, notes, and snippets.

View tablacus's full-sized avatar

Gaku tablacus

View GitHub Profile
@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 / OpenNextFolder.js
Last active April 23, 2022 09:43
Open next folder - Tablacus Explorer
const FV = GetFolderView(Ctrl, pt);
const pid1 = FV.FolderItem;
const Items = api.ILGetParent(pid1).GetFolder.Items();
const ar = [];
for (let i = Items.Count; i-- > 0;) {
ar[i] = i;
}
ar.sort(function (a, b) {
return api.CompareIDs(0, Items.Item(a), Items.Item(b));
});
@tablacus
tablacus / autocolumnssize.js
Created May 10, 2018 22:14
Auto columns size - Tablacus Explorer
FV.CurrentViewMode(4,16);
setTimeout(function()
{
FV.Columns ='"System.ItemNameDisplay" -2 "System.DateModified" -2 "System.Size" -2 "System.ItemTypeText" -2';
}, 99);
@tablacus
tablacus / ToggleShellExecuteHooks.js
Last active April 7, 2022 18:14
EnableShellExecuteHooks "toggle" with Tablacus Explorer Add-on Shell execute hook 1.02 or higher.
var toggle;
try {
  toggle = !wsh.RegRead("HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\EnableShellExecuteHooks");
} catch (e) {
  toggle = true;
}
var ex = { EnableShellExecuteHooks: toggle, Explorer: true };
OpenNewProcess("addons\\shellexecutehook\\worker.js", ex, false, WINVER >= 0x600 ? "RunAs" : null);
@tablacus
tablacus / switchbrowser.js
Created November 14, 2021 10:03
Trident <--> Blink - Tablacus Explorer
wsh.CurrentDirectory = fso.BuildPath(te.Data.Installed, 'lib');
if (window.chrome) {
fso.MoveFile('tewv64.dll', '_tewv64.dll');
fso.MoveFile('tewv32.dll', '_tewv32.dll');
} else {
fso.MoveFile('_tewv64.dll', 'tewv64.dll');
fso.MoveFile('_tewv32.dll', 'tewv32.dll');
}
FinalizeUI();
te.Reload(1);
@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_selection_with_inline_renaming.js
Created December 18, 2021 13:59
Toggle selection with inline renaming - Tablacus Explorer
const hEdit = api.SendMessage(FV.hwndList, LVM_GETEDITCONTROL, 0, 0);
const fn = api.GetWindowText(hEdit);
let start = api.SendMessage(hEdit, 0xB0, 0, 0);//EM_GETSEL
const end = Math.floor(start >> 16);
start &= 0xffff;
if (fn.indexOf(".") >= 0) {
if (start) {
api.SendMessage(hEdit, 0xB1, 0, fn.length);//EM_SETSEL
} else {
if (end == fn.length) {
@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);