From mac
Authors JXA (JavaScript for Automation) scripts for macOS app automation using Application() calls. Covers ES5 syntax constraints, run() function structure, for-loops, properties(), and .whose() filtering.
npx claudepluginhub bendrucker/claude --plugin macThis skill uses the workspace's default tool permissions.
JavaScript for Automation (JXA) automates macOS apps via the `Application()` bridge. It runs on JavaScriptCore (ES5).
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
JavaScript for Automation (JXA) automates macOS apps via the Application() bridge. It runs on JavaScriptCore (ES5).
var (not let/const).map(), .filter(), .forEach())run() (not an object)// WRONG: JXA arrays don't have .map()
// var names = app.windows().map(function(w) { return w.name(); });
// CORRECT: use a for-loop
var windows = app.windows();
var names = [];
for (var i = 0; i < windows.length; i++) {
names.push(windows[i].name());
}
Script files define a function run(argv) entry point. osascript calls it automatically and prints the return value. The function must be named run, not _run.
#!/usr/bin/env osascript -l JavaScript
function run(argv) {
var finder = Application("Finder");
var items = finder.desktop.items();
var names = [];
for (var i = 0; i < items.length; i++) {
names.push(items[i].name());
}
return JSON.stringify(names);
}
properties() for batch reads instead of individual getters.whose() for filtering when the app supports it (pushes work to the app)Application.currentApplication() accesses the current app contextsdef /Applications/AppName.app