Using a UIWebView in ASOC

Hi everybody,

Happy new year. I’m new to this forum and I’d like to ask you a little question about using WebView in ApplescriptObjC.

If the cocoa code for loading a web view looks like this,

NSString *urlAddress = @“http://www.apple.com”;

//Create a URL object.
NSURL *myurl = [NSURL URLWithString:urlAddress];

//URL Requst Object
NSURLRequest *requestObj = [NSURLRequest requestWithURL:myurl];

//Load the request in the UIWebView.
[mywebView loadRequest:requestObj];


, then where is the mistake in this ASOC version?

property mywebView : missing value
property urlAddress : “http://www.apple.com

on load_webview_(sender)
tell class “NSURL” of current application
set myurl to URLWithString_(urlAddress)
end tell

tell class "NSURLRequest" of current application
	set myurlobj to requestWithURL_(myurl)
end tell

mywebView's loadRequest_(myurlobj)

end load_webview_


Thanks a lot for your help.

jpg

mywebView's mainFrame's loadRequest_(myurlobj)

Excellent. Thank you Craig.
I was reading the iPhone documentation where it seems there is no main frame for a webview object…

Can someone help me?

--
--  Webkit_BrowserAppDelegate.applescript
--  Webkit Browser
--
--  Created by Dylan Weber on Monday, January 4, 2010.
--  Copyright 2010 __MyCompanyName__. All rights reserved.
--

script Webkit_BrowserAppDelegate
	property webview : missing value
	property internetlocation : missing value
	
	on internet_(sender)
		set myurlobj to internetlocation's stringValue()
		webview's mainFrame's loadRequest_(myurlobj)
	end internet_
end script

I also got this in the log:

You should add the WebKit framework to your project.