0

Word 2004 ファイルで Applescript を使用して検索/置換を実行しようとしています。OS 10.6.8 を使用する iMac で。

サンプルコード:

tell application "Microsoft Word"
activate
set myText to text object of selection
set myFind to find object of myText
clear formatting myFind
set italic of font object of myFind to true
set content of myFind to ""
clear formatting replacement of myFind
set content of replacement of myFind to "<I>^&</I>"
execute find myFind replace replace all
end tell

このコードを実行しようとするたびに、「クリア フォーマット ...」行に到達した瞬間にスクリプトがフリーズします。Applescript は次のエラーを吐き出します。

エラー「Microsoft Word でエラーが発生しました: AppleEvent がタイムアウトしました。」番号 -1712

これを解決する方法を知っている人はいますか?

4

1 に答える 1