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

Method hideApp

src/main/utils/appleScriptHelper.ts:293–306  ·  view source on GitHub ↗

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

(appName: string)

Source from the content-addressed store, hash-verified

291 * @returns 是否成功隐藏
292 */
293 async hideApp(appName: string): Promise<boolean> {
294 try {
295 const script = `
296 tell application "System Events"
297 set visible of process "${appName}" to false
298 end tell
299 `
300 await this.execute(script)
301 return true
302 } catch (error) {
303 console.error(`[AppleScript] 隐藏应用 ${appName} 失败:`, error)
304 return false
305 }
306 }
307
308 /**
309 * 执行粘贴操作(模拟 Command+V)

Callers

nothing calls this directly

Calls 1

executeMethod · 0.95

Tested by

no test coverage detected