- 2008-02-25 (月)
- AppleScript
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
参考にさせてもらったページ
- MACFreak
- macosxhints.com - Save selected browser text via AppleScript
- macosxhints.com - Fully automated, one-step sending of a URL from Safari
- Firefox 版アンカータグを作成する AppleScript
鳥獣保護区 | Firefox で開いているページを Safari で開く で紹介されている、拡張機能 + JavaScript を使った方法もあるみたい。
関連する記事
Comments: 0
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