Skip to content

Instantly share code, notes, and snippets.

View johnlindquist's full-sized avatar
💭
Eating a taco 🌮

John Lindquist johnlindquist

💭
Eating a taco 🌮
View GitHub Profile
@johnlindquist
johnlindquist / focus-tab-explanation.md
Last active April 5, 2025 19:57
Focus-Tab: AppleScript utility for opening or focusing browser tabs from the command line

Focus-Tab: Browser Tab Manager for macOS

Overview

Focus-Tab is an AppleScript utility that allows you to quickly open or switch to specific websites in your browser from the command line. It's particularly useful for:

  • Workflow automation
  • Quick navigation to frequently visited sites
  • Scripts and shell aliases for browser-based tools
  • Integration with other automation tools
Let me break down how `showInactive()` works on Windows and explain the rendering behavior:
1. For Windows, `showInactive()` is implemented in `native_window_views.cc`:
```478:487:shell/browser/native_window_views.cc
void NativeWindowViews::ShowInactive() {
widget()->ShowInactive();
NotifyWindowShow();
import "@johnlindquist/kit"
import schedule from "node-schedule"
export const metadata: Metadata = {
name: "Testing Node Schedule",
background: "auto",
}
type ScheduleState = {
name: string
import "@johnlindquist/kit"
import type { Choice } from "@johnlindquist/kit"
export const metadata: Metadata = {
name: "Testing Grid",
}
function generateGrid(count: number):Choice[] {
return Array.from({ length: count }, (_, i) => ({
name: `item-${i}`,
import "@johnlindquist/kit"
import type { Choice } from "@johnlindquist/kit"
export const metadata: Metadata = {
name: "Testing Grid",
}
function generateGrid(count: number):Choice[] {
return Array.from({ length: count }, (_, i) => ({
name: `item-${i}`,
import "@johnlindquist/kit"
import type { Action } from "@johnlindquist/kit"
export const metadata: Metadata = {
name: "Testing Change Actions on Focus",
}
// Define possible states
type ActionState = "open" | "closed"
// Name: Testing Prevent Submit
import "@johnlindquist/kit";
await arg(
{
placeholder: "Prevent Submit",
enter: "Speak",
onSubmit: (input, state) => {
say(state.focused.value);
// Name: Testing Prevent Submit
import "@johnlindquist/kit";
await arg(
{
placeholder: "Prevent Submit",
enter: "",
},
["one", "two", "three"],
{
"animals": {
"name": "Animals",
"words": [
"Dog",
"Lion",
"Elephant",
"Giraffe",
"Penguin",
"Dolphin",
// Name: Testing Script Bundle
// Shortcut: ctrl 0
import "@johnlindquist/kit";
const script = await selectScript("Testing", true, (scripts) =>
scripts.filter((script) => script.name.startsWith("Testing"))
);
await run(script.filePath);