Home > AppleScript > [ AppleScript ] Firefox で開いているページを Safari で開く

[ AppleScript ] Firefox で開いているページを Safari で開く

AppleScript を使って Firefox から URL を取得する方法が見つかったので、Firefox で開いているページを Safari で開くアップルスクリプトを書いてみた。

Firefox で開いているページを Safari で開く AppleScript

tell application "Firefox"
    set theURL to «class curl» of window 1
end tell
tell application "Safari"
    activate
    open location theURL
end tell

«class curl» を使うと Firefox から URL を取得できるんだが、何故取得できているのか調べてみたけど解らなかった。うーん。

Safari で開いているページを Firefox で開く AppleScript

ついでに Safari で開いているページを Firefox で開くアップルスクリプトを書いてみた。

tell application "Safari"
    set theURL to (get URL of document 1)
end tell
set the clipboard to theURL
tell application "Firefox" to activate
tell application "System Events" to keystroke "t" using {command down}
tell application "System Events" to keystroke "v" using {command down}
tell application "System Events" to keystroke return

参考にさせてもらったページ

鳥獣保護区 | Firefox で開いているページを Safari で開く で紹介されている、拡張機能 + JavaScript を使った方法もあるみたい。

関連する記事

Comments: 0

Comment Form
Remember personal info

Trackback+Pingback: 0

TrackBack URL for this entry
http://bowz.info/1327/trackback
Listed below are links to weblogs that reference
[ AppleScript ] Firefox で開いているページを Safari で開く from Bowz::Notebook

Home > AppleScript > [ AppleScript ] Firefox で開いているページを Safari で開く

タグクラウド

Return to page top