2015-10-21 52 views
0

我的applescript無法正常工作。我想要一個在我的Mac上執行⌘+的按鍵。 這是我目前的代碼。Applescript Keystroke「⌘+」給出錯誤

set abc to "+" 
tell application "System Events" 
keystroke command & abc 
keystroke a 
end tell 

當我點擊播放,我得到的錯誤

"System Events got an error: Can’t make {command, \"n\"} into type text." number -1700 from {command, "n"} to text.

任何人都知道如何解決這一問題?

回答

1

的語法按修改鍵是

set abc to "+" 
tell application "System Events" 
    keystroke abc using command down 
end tell