Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/categories/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ScriptCategory } from "../types/index.js";
/**
* System-related scripts.
* * volume: Set system volume
* * get_volume: Get current system volume
* * get_frontmost_app: Get the name of the frontmost application
* * launch_app: Launch an application
* * quit_app: Quit an application
Expand All @@ -28,6 +29,19 @@ export const systemCategory: ScriptCategory = {
},
script: (args) => `set volume ${Math.round((args.level / 100) * 7)}`,
},
{
name: "get_volume",
description: "Get current system volume level (0-100)",
script: `
try
-- Get the current output volume from system settings (returns 0-100)
set currentVolume to output volume of (get volume settings)
return "Current volume level: " & currentVolume & "%"
on error errMsg
return "Failed to get volume: " & errMsg
end try
`,
},
{
name: "get_frontmost_app",
description: "Get the name of the frontmost application",
Expand Down