Skip to content

Instantly share code, notes, and snippets.

@pointum
pointum / readiness.js
Created September 24, 2026 00:59
Check macOS Spotlight semantic indexing readiness
// Spotlight semantic search readiness, as reported by CoreSpotlight.
// Usage: osascript -l JavaScript readiness.js [pipeline] (default: Embedding)
// Or paste into Script Editor and pick JavaScript instead of AppleScript language
ObjC.import('CoreSpotlight');
const bind = (name, signature) => ObjC.bindFunction(name, signature);
bind('xpc_connection_create_mach_service', ['pointer', ['char *', 'pointer', 'unsigned long long']]);
bind('xpc_connection_set_event_handler', ['void', ['pointer', 'id']]);
bind('xpc_connection_resume', ['void', ['pointer']]);
tell application "HazeOver"
set myFocusMode to not enabled
set enabled to myFocusMode
end tell
tell application "System Events"
tell dock preferences to set autohide to myFocusMode
end tell
do shell script "defaults write -g _HIHideMenuBar -bool " & myFocusMode as integer