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

Method showNotification

src/main/utils/appleScriptHelper.ts:209–221  ·  view source on GitHub ↗

* 显示系统通知 * @param title 通知标题 * @param message 通知内容 * @param subtitle 通知副标题(可选) * @returns 是否成功显示

(title: string, message: string, subtitle?: string)

Source from the content-addressed store, hash-verified

207 * @returns 是否成功显示
208 */
209 async showNotification(title: string, message: string, subtitle?: string): Promise<boolean> {
210 try {
211 const subtitlePart = subtitle ? `subtitle "${subtitle}"` : ''
212 const script = `
213 display notification "${message}" with title "${title}" ${subtitlePart}
214 `
215 await this.execute(script)
216 return true
217 } catch (error) {
218 console.error('[AppleScript] 显示通知失败:', error)
219 return false
220 }
221 }
222
223 /**
224 * 获取所有运行中的应用程序列表

Callers

nothing calls this directly

Calls 1

executeMethod · 0.95

Tested by

no test coverage detected