FirefoxがVersion 3になって、ページタイトルが取得できなくなって困っていたのだが、取得できたのでメモっておく。
Firefox2までは、こんなスクリプトで取得できていたのだが...
tell application "Firefox"
set theTitle «class pTit» of front window
end tell
Firefox3では、変な文字列になってしまった。
で、こんなスクリプトを使うとタイトルは取得できるのだが、URLを取得するスクリプトがエラーになってしまう。
tell application "Firefox"
activate
set theTitle the name of front window
end tell
URLを取得するスクリプトは、これ。
tell application "Firefox"
set theURL «class curl» of front window
end tell
試行錯誤した結果、以下のスクリプトでうまくいった。
ただし、「ユニバーサルアクセス」環境設定の“補助装置にアクセスできるようにする”をチェックすることが必要。
tell application "System Events"
tell process "Firefox"
set theTitle the name of front window
end tel
end tell
「補助装置にアクセスできるようにする」と UI Elements を使うことができるのだとか。
最近のコメント