我有一個腳本比登錄,請問用戶,如果他們想看電影。大多數情況下,它的效果很好。但有時和我不明的原因,我得到一個AppleEvent處理程序失敗的錯誤。我讀過關於這個錯誤的其他帖子,但他們似乎都是獨一無二的。所以,如果可能的話,有人可以看看我的劇本,並告訴我爲什麼偶爾會彈出,如果有什麼我可以做,以防止它?AppleScript - AppleEvent處理程序失敗
有一件事可能有助於知道腳本中發生此錯誤時失敗的一件事是電影無法播放。它在quicktime打開,但不啓動。
在此先感謝,下面是腳本。
tell application "Welcome" to activate
set question to display dialog "Would you like a welcome video?" buttons {"No, I've seen it", "Yes, please"} default button 2
set answer to button returned of question
if answer is equal to "Yes, please" then tell application "QuickTime Player"
set theMovie to "Macintosh HD:Library:Desktop Pictures:Mac ML Opening Chalkbaord Video.mov"
set openMovie to open theMovie
present openMovie
play openMovie
delay 30
quit
end tell
if answer is equal to "No, I've seen it" then tell application "Welcome"
quit
tell application "System Events"
delete login item "Welcome"
end tell
end tell
有什麼場合?一些背景可以走很長的路。準備好編輯你的問題,因爲你可以更深入地瞭解上下文和條件。 –