Skip to content

Instantly share code, notes, and snippets.

View tablacus's full-sized avatar

Gaku tablacus

View GitHub Profile
@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 / focusframe.js
Last active November 8, 2021 12:01
Focus frame - tablacus Explroer
const hTree = FindChildByClass(FV.hwnd, WC_TREEVIEW);
if (hTree) {
api.SetFocus(hTree);
}
return S_OK;
@tablacus
tablacus / openfavoritesmenu.js
Created October 30, 2021 03:38
Open favorites menu - Tablacus Explorer
const pt = api.Memory("POINT");
api.ClientToScreen(te.hwnd, pt);
ExecMenu(te, "Favorites", pt, 0);
return S_OK;
@tablacus
tablacus / selectitemandgodown.js
Created October 13, 2021 22:46
Select item and go one down - Tablacus Explorer
let nIndex = FV.GetFocusedItem;
FV.SelectItem(nIndex, SVSI_SELECT);
if (++nIndex < FV.ItemCount(SVGIO_ALLVIEW)) {
FV.SelectItem(nIndex, (Ctrl.hwndList && api.SendMessage(Ctrl.hwndList, LVM_GETITEMSTATE, nIndex, LVIS_SELECTED) ? SVSI_SELECT : SVSI_DESELECT) | SVSI_ENSUREVISIBLE | SVSI_FOCUSED);
}
@tablacus
tablacus / copyfilename.js
Last active October 8, 2021 13:21
Copy file name to clipboard - Tablacus Explorer
clipboardData.setData("text", (FV.FocusedItem || FV.FolderItem).Name);
@tablacus
tablacus / widerightclick.js
Created September 16, 2021 10:59
Wide right click - Tablacus Explorer
const iItem = FV.HitTest(pt, LVHT_ONITEM);
if (iItem >= 0) {
FV.SelectItem(iItem, SVSI_SELECT | SVSI_FOCUSED | SVSI_DESELECTOTHERS);
}
return S_FALSE;
@tablacus
tablacus / savelayoutow.js
Created July 19, 2021 11:09
Save layout overwrite
if (te.Data.LayoutPath) {
SaveXml(te.Data.LayoutPath);
} else {
SaveLayout();
}
return S_OK;
@tablacus
tablacus / loadlayoutow.js
Created July 19, 2021 11:07
Load layout overwrite
const commdlg = api.CreateObject("CommonDialog");
commdlg.InitDir = BuildPath(te.Data.DataFolder, "layout");
commdlg.Filter = MakeCommDlgFilter("*.xml");
commdlg.Flags = OFN_FILEMUSTEXIST;
if (commdlg.ShowOpen()) {
te.Data.LayoutPath = commdlg.FileName;
LoadXml(commdlg.FileName);
}
return S_OK;
@tablacus
tablacus / focustreeviewfrominneraddressbar.js
Last active June 20, 2021 01:08
Focus Tree view from Inner Address bar - Tablacus Explorer
window.addEventListener("keydown", function (ev) {
if (ev.keyCode == VK_TAB) {
const res = /inneraddressbar_(\d+)/i.exec((ev.target || ev.srcElement).id);
if (res) {
setTimeout(async function () {
const FV = te.Ctrl(CTRL_TC, res[1]).Selected;
FV.Focus();
FV.TreeView.Focus();
}, 99);
if (ev.preventDefault) {
@tablacus
tablacus / selecttotop.js
Last active March 21, 2021 13:27
All selected items on top of the list - Tablacus Explorer
const FV = GetFolderView(Ctrl, pt);
const Selected = FV.Items(SVGIO_SELECTION | SVGIO_FLAG_VIEWORDER);
const Progress = api.CreateObject("ProgressDialog");
Progress.StartProgressDialog(te.hwnd, null, 2);
const Name = GetText("Selected items");
try {
FV.SelectItem(null, SVSI_DESELECTOTHERS);
const IconSize = FV.IconSize;
const ViewMode = api.SendMessage(FV.hwndList, LVM_GETVIEW, 0, 0);
if (ViewMode == 1 || ViewMode == 3) {