私はまったくばかげた問題を抱えています。 plistファイルのノードにアクセスする必要があります。問題がある場合は、ダイアログに「停止」アイコンが表示されます。ここでは、コードです:それは大胆な青いフォントでだからアイコンストップ&システムイベントのApplescriptと表示ダイアログ
tell application "System Events"
tell property list file (plistFile as text)
try
tell contents
set backupDayTemp to value of property list item plistElementBackupDay of property list item chosenBackupDisk
end tell
on error m number n from f to t partial result p
if n = -1728 then
display dialog "Can't find " & plistElementBackupDay & " key for disk " & chosenBackupDisk & " in plist file." buttons {"Damn", "Oh dear"} default button "Damn" with title myName with icon stop
return
else
-- otherwise, pass the error on
error m number n from f to t partial result p
end if
end try
end tell
end tell
コンパイラはシステムイベントは、トークンが「停止」を理解するべきものであると考えているようだが、ない紫色のイタリック体は、それが正常であること、いつであろうと。エラーハンドラが実行されました。「システムイベントにエラーがあります:プロパティリストファイル[パス]が「停止」メッセージを理解していません。
私の質問は、トークンがそれではないことをシステムイベントにどのように伝えますか?私はの前にtell me to
を置こうとしましたが、それは助けになりませんでした。私もusing terms from application "Standard Additions"
を試しましたが、実行するとStandard Additionsの辞書を探すよう求められます。
私の髪を引き裂く!
のtellアプリケーションは、「Finderは」ダイアログを表示するようにブロック伝えるアプリケーションのうち、エラー処理を置くことです、あなたのアプリケーションの焦点をFinderに変更するということです。 – pbell