MCPcopy Index your code
hub / github.com/ZToolsCenter/ZTools / quitApp

Method quitApp

src/main/utils/appleScriptHelper.ts:273–286  ·  view source on GitHub ↗

* 退出指定应用程序 * @param appName 应用程序名称 * @returns 是否成功退出

(appName: string)

Source from the content-addressed store, hash-verified

271 * @returns 是否成功退出
272 */
273 async quitApp(appName: string): Promise<boolean> {
274 try {
275 const script = `
276 tell application "${appName}"
277 quit
278 end tell
279 `
280 await this.execute(script)
281 return true
282 } catch (error) {
283 console.error(`[AppleScript] 退出应用 ${appName} 失败:`, error)
284 return false
285 }
286 }
287
288 /**
289 * 隐藏指定应用程序

Callers 1

allCodeEvent.tsFile · 0.80

Calls 1

executeMethod · 0.95

Tested by

no test coverage detected