The Edge browser has a Workspaces feature. It would be nice to have the ability to search for a workspace and navigate to it. If it's hard to search for just a workspace, I guess a window search would be fine.
example)
list-workspaces.js
#!/usr/bin/env osascript -l JavaScript
function run(args) {
let browser = args[0];
if (!Application(browser).running()) {
return JSON.stringify({
items: [{
title: `${browser} is not running`, subtitle: `Press enter to launch ${browser}`,
},],
});
}
let chrome = Application(browser);
chrome.includeStandardAdditions = true;
let items = [];
for (let window in chrome.windows) {
let windowId = chrome.windows[window].id();
items.push({
title: chrome.windows[window].title(),
arg: `${windowId}`,
});
}
return JSON.stringify({items});
}
focus-workspace.js
#!/usr/bin/env osascript -l JavaScript
function run(args) {
ObjC.import("stdlib");
let browser = $.getenv("browser");
let query = args[0];
let [arg1] = query.split(",");
let windowId = parseInt(arg1);
focusWindow(browser, windowId);
}
function focusWindow(browserName, windowId) {
let chrome = Application(browserName);
chrome.includeStandardAdditions = true;
let window = chrome.windows.byId(windowId);
window.visible = true;
window.index = 1;
chrome.activate();
}
The Edge browser has a Workspaces feature. It would be nice to have the ability to search for a workspace and navigate to it. If it's hard to search for just a workspace, I guess a window search would be fine.
example)
list-workspaces.js
focus-workspace.js