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 / openInOtherPane.js
Created February 23, 2021 12:19
The same folder to open in the other pane. (* Add-on "Switch to next pane" is required.)
const FV = GetFolderView(Ctrl, pt);
NavigateFV(Sync.SwitchPane.NextFV(FV), FV, SBSP_SAMEBROWSER);
@tablacus
tablacus / movetonextpane.js
Last active October 4, 2023 13:23
Move current tab to next pane * require "Switch to next pane" - Tablacus Explorer
var FV = GetFolderView(Ctrl, pt);
var FV2 = Sync.SwitchPane.NextFV(Ctrl);
FV.Parent.Move(FV.Parent.SelectedIndex, FV2.Parent.Count, FV2.Parent);
@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 / MoveTo.js
Last active May 26, 2023 04:26
Move selected items to c:\test - Tablacus Explorer
var FV = GetFolderView(Ctrl, pt);
var Selected = FV.SelectedItems();
if (Selected && Selected.Count) {
var DropTarget = api.DropTarget("c:\\test");
DropTarget.Drop(Selected, MK_LBUTTON | MK_SHIFT, pt, Selected.pdwEffect);
}
@tablacus
tablacus / OpenClipboardPath.js
Last active May 26, 2023 04:26
Open clipboard path in new tab - Tablacus Explorer
var Items = api.OleGetClipboard();
if (Items.Count) {
for (var i = 0; i < Items.Count; i++) {
Navigate(Items.Item(i), SBSP_NEWBROWSER);
}
return;
}
Items = String(clipboardData.getData("text")).split(/[\r\n]+/);
for (var i in Items) {
if (/^"?[A-Z]:\\|^"?\\\\[A-Z]|^"?::{/i.test(Items[i])) {
@tablacus
tablacus / CopyTo.js
Last active May 26, 2023 04:25
Copy selected items to c:\test - Tablacus Explorer
var FV = GetFolderView(Ctrl, pt);
var Selected = FV.SelectedItems();
if (Selected && Selected.Count) {
var DropTarget = api.DropTarget("c:\\test");
DropTarget.Drop(Selected, MK_LBUTTON | MK_CONTROL, pt, Selected.pdwEffect);
}
@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);
}