2014-01-27 21 views
0

我正在寫需要粘貼文本從一個入口在一個對話框複製和

set query to text returned of (display dialog "Enter Text" default answer "" buttons {"Input", "Cancel"} default button 1) 
query 
tell application "System Events" 
    keystroke "c" using command down 
    keystroke "v" using command down 
end tell 

當我運行該腳本它複製和粘貼「集抄和腳本粘貼文本查詢到文本...「

我該如何複製我輸入的查詢?我將在稍後粘貼文本,但我需要弄清楚如何實際複製文本。我是用按鍵的查詢,但是這是需要很長的時間,當絲線長

回答

0

使用set the clipboard

display dialog "" default answer "" 
set the clipboard to text returned of result 

如果別人得到這裏搜索如何處理,例如從所示的對話框複製一個長期的錯誤信息通過OS X,您可以使用/Applications/Xcode.app/Contents/Applications/中的Accessibility Inspector。