Get Source of Current Tab in Google Chrome via Applescript

It's child's play to do this in Safari, which has good Applescript support. Google Chrome's AS support has just arrived so I'm giving them the benefit of the doubt. I am basically trying to grab the current HTML via the clipboard so I can get information out. We have some nifty commands like this:

tell application "Google Chrome"
 view source of active tab of window 1
 save active tab of window 1
 print active tab of window 1
 reload active tab of window 1
 go back active tab of window 1
 go forward active tab of window 1
 copy selection of active tab of window 1
 paste selection active tab of window 1
end tell

but alas you can't say "set X to source of active tab of window 1". Anyone have any suggestions for me? My current ideas are to load the code I need in the background in Safari (pretty ugly) or try to display source and grab it with UI script, but that's also ugly. Also I keep encountering scripting bugs that keep it from working.

Any help would be appreciated.

6
задан markratledge 14 December 2010 в 18:38
поделиться