これまでの私のスクリプトは次のとおりです。
property timeDelay : 5
on appOpen(appName)
tell application "System Events" to set appNameIsRunning to exists (processes where name is appName)
return appNameIsRunning
end appOpen
if appOpen("iChat") then
tell application "iChat"
repeat with theService in services
if connection status of theService = disconnected or connection status of theService = disconnecting then
log in of service (name of theService)
end if
end repeat
end tell
end if
基本的に、iChat/Messages アカウントのいずれかがログアウトされているかどうかを 1 回チェックします。そうであれば、ログインしてください。
ただし、これを「Stay Open」アプリにしたいと思います。過去に私はパターンを使用しました
on idle
-- do stuff
end idle
..しかし、何らかの理由でコンパイルしようとするとエラーになります。
なぜこれが起こっているのでしょうか?
編集:
わかりました-なぜこれが発生したのかはまだわかりませんが、新しいスクリプトを作成するだけで問題を解決できました. このエラーが発生した理由はわかりませんが、今は問題ないようです。助けてくれてありがとう。