MCPcopy Create free account
hub / github.com/ZToolsCenter/ZTools / paste

Method paste

src/main/utils/appleScriptHelper.ts:312–326  ·  view source on GitHub ↗

* 执行粘贴操作(模拟 Command+V) * @returns 是否成功执行粘贴

()

Source from the content-addressed store, hash-verified

310 * @returns 是否成功执行粘贴
311 */
312 async paste(): Promise<boolean> {
313 try {
314 const script = `
315 tell application "System Events"
316 keystroke "v" using command down
317 end tell
318 `
319 await this.execute(script)
320 console.log('[AppleScript] 已执行粘贴操作 (Command+V)')
321 return true
322 } catch (error) {
323 console.error('[AppleScript] 执行粘贴操作失败:', error)
324 return false
325 }
326 }
327}
328
329// 导出单例

Callers

nothing calls this directly

Calls 1

executeMethod · 0.95

Tested by

no test coverage detected