Home > [ サンプル ] その他アプリ > [ AppleScript ] Firefox で開いているページを Safari で開く

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

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

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

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

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

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

Trackbacks:0

Trackback URL for this entry
http://applescript.bowz.info/1327/trackback
Listed below are links to weblogs that reference
[ AppleScript ] Firefox で開いているページを Safari で開く from AppleScript 文法・サンプル集

Home > [ サンプル ] その他アプリ > [ AppleScript ] Firefox で開いているページを Safari で開く

Feeds
Meta
その他の管理人運営ブログ

Return to page top