Hi, I’ve been lurking for a bit but have run into a problem that I just cannot find the answer to. I have a large family of scripts that rely on Safari’s do JavaScript and the document properties like source of and text of. I am now working on an XCode Applescript app that has several webviews and a tab with a summary of the data contained within the webpages displayed in the web views. I found the following function online which i have adapted in my script for my needs but I cannot figure out how to get into the dom or get the text/source of the page. Any help even a link off to an object reference and how to read it would be greatly appreciated. In highschool computer science class was C and Pascal and I’ve handled up on JavaScript pretty well i think but have not ventured into Objective C or any of the cool object oriented languages. Anyhow thanks alot I really hope someone out there can help.
Is there maybe a different ?method or property i can access of mainFrame ???
Thank you in advance
* on loadPage from theURL
o set URLWithString to call method "URLWithString:" of class "NSURL" with parameter theURL
o set requestWithURL to call method "requestWithURL:" of class "NSURLRequest" with parameter URLWithString
o tell window "main"
+ set mainFrame to call method "mainFrame" of object (view "browser")
o end tell
o call method "loadRequest:" of mainFrame with parameter requestWithURL
* end loadPage