Skip to content

Instantly share code, notes, and snippets.

@johnlindquist
Created January 3, 2024 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnlindquist/9d99e8e6b2128c6cc1ac367b2692d006 to your computer and use it in GitHub Desktop.
Save johnlindquist/9d99e8e6b2128c6cc1ac367b2692d006 to your computer and use it in GitHub Desktop.
// Name: Toggle Transcribe
import "@johnlindquist/kit"
let ahScript = `
let sessionName = "Transcribe"; //Set me to the target session
let session = app.sessionWithName( sessionName )
if( session.running )
session.stop()
else
session.start()
`
let ahScriptPath = kenvPath("ah", "toggle-transcribe.ahcommand")
await ensureDir(path.dirname(ahScriptPath))
await writeFile(ahScriptPath, ahScript)
console.log(`Opening Audio Hijack with script: ${ahScriptPath}`)
await exec(`open -b com.rogueamoeba.audiohijack ${ahScriptPath}`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment