View Single Post
Quote:
Originally Posted by Krioni
set downloadFilePath to ((path to desktop) as string) & "pagedownload.html"
tell application "OmniWeb"
set pageAddress to address of active tab of browser 1
OpenURL pageAddress to (POSIX path of downloadFilePath)
end tell
Thanks, Krioni !

I couldn't get the OpenURL method to work on my system -- this line resulted in what looked to me like a file containing binary contents when opened with BBEdit:

OpenURL pageAddress to (POSIX path of downloadFilePath)

However, your curl tip did just what I wanted. Here's what I ended up with:

tell application "OmniWeb"
set owAddress to the address of the active tab of the browser of the active workspace
set owUrl to the first item of owAddress
set owSource to (do shell script "curl " & quoted form of owUrl)

tell application "BBEdit"
activate

if exists text window 1 then
make new text document at text window 1 with properties {contents:owSource, source language:"HTML"}
else
make new text window with properties {contents:owSource, source language:"HTML"}
end if
select insertion point before character 1 of text window 1

end tell

end tell

Until there's a formal OW reference, this will do fine...

Thanks again,

Rob

Last edited by eYeToEyeRob; 2006-06-30 at 08:39 PM.. Reason: To add Title