2016-11-19 50 views

回答

0

默認情況下,在您的系統參數/鍵盤捷徑/服務中,有一個功能「創建一個音符」,它被分配給鍵(shift命令y)。那麼你只需要在Applescript中模擬這些密鑰爲:

tell application "TextEdit" to activate -- assume your text is already selected 
tell application "System Events" to keystroke "Y" using command down 

你選中的文本將被複制到一個新的筆記中。

0

對於automator服務最簡單的是創建對所需應用程序的調用。在使用腳本之下,將在TexEdit中選定的文本複製到剪貼板,然後打開Notes應用程序並使用Notes應用程序中的編輯菜單和粘貼菜單結束。它必須經常工作得很好。 (更改菜單中的名稱,我認爲它應該是粘貼和編輯)

on run {input, parameters} 
     activate application "Notes" 
     tell application "System Events" to tell process "Notes" 
     try    
      keystroke "c" using command down 
      set frontmost to true 
      click menu item "Paste" of menu "Edit" of menu bar 1 
      end try 
     end tell 
     return input 
     end run 
相關問題