我想使用AppleScript設置Messages.app聊天窗口的位置。用AppleScript設置窗口的位置
tell application "System Events"
set position of window 1 of application "Messages" to {100, 100}
end tell
有了這個代碼,我得到一個錯誤:
error "Messages got an error: Can’t set «class posn» of window 1 to {100, 100}."
number -10006 from «class posn» of window 1
這是什麼意思?
如果我用Finder嘗試相同的代碼,它就可以工作。但大多數其他應用程序不起作用。
的腳本不能正常工作,因爲沒有'應用程序「消息」的AppleScript字典position'財產。只需用'進程'消息''替換'應用程序'消息''。 – jackjr300