Skip to content

Instantly share code, notes, and snippets.

View tablacus's full-sized avatar

Gaku tablacus

View GitHub Profile
@tablacus
tablacus / ZipIsFolder.js
Created October 9, 2024 12:17
Zip, etc. are regarded as folders - Tablacus Explorer
IsFolderEx = function (Item) {
return Item.IsFolder;
}
@tablacus
tablacus / external.js
Created June 19, 2024 22:50
Control from the outside scripts - Tablacus Explorer
var sha = new ActiveXObject("Shell.Application");
var sw = sha.Windows();
for (var i = 0; i < sw.Count; ++i) {
var x = sw.item(i);
if (x && x.Document) {
var w = x.Document.parentWindow;
if (w && w.te && w.te.Data) {
var FV = w.GetFolderView();
WScript.Echo(FV.FolderItem.Path);
}
@tablacus
tablacus / dupulicatetab.js
Created June 7, 2024 13:27
Duplicate tab
FV.Navigate(FV.History, SBSP_NEWBROWSER);
@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);
}
});