Skip to content

Instantly share code, notes, and snippets.

View tablacus's full-sized avatar

Gaku tablacus

View GitHub Profile
@tablacus
tablacus / controlpanelmenu.js
Created June 16, 2023 09:44
Control panel menu - Tablacus Explorer
View controlpanelmenu.js
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
View copy_tabs.js
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
View refreshandapply.js
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
View newfolder.js
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
View toggle_fullscreen.js
ToggleFullscreen();
@tablacus
tablacus / copyaspath.js
Created January 11, 2022 22:44
Copy as path - Tablacus Explorer
View copyaspath.js
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
View toggle_seletion.js
const nFocused = FV.GetFocusedItem;
const bSelected = api.SendMessage(FV.hwndList, LVM_GETITEMSTATE, nFocused, LVIS_SELECTED);
FV.SelectItem(nFocused, bSelected ? SVSI_DESELECT : SVSI_SELECT);
@tablacus
tablacus / timeout.js
Created December 26, 2021 12:36
Switch add-ons after 500ms - Tablacus Explorer
View timeout.js
setTimeout(function () {
Exec(te, ["cmigemo,0", "filterlist,1"].join("\n"), "Addon switcher");
}, 500);
@tablacus
tablacus / toggle_selection_with_inline_renaming.js
Created December 18, 2021 13:59
Toggle selection with inline renaming - Tablacus Explorer
View toggle_selection_with_inline_renaming.js
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 / open_chrome_form_url_shortcut.js
Created December 17, 2021 13:01
Open chrome from url shortcut - Tablacus Explorer
View open_chrome_form_url_shortcut.js
const Selected = FV.SelectedItems();
if (Selected.Count != 1) {
return;
}
wsh.run('"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe "' + Selected.Item(0).ExtendedProperty("linktarget"));