Loading a webpage/searching

How would you tell a web view to load a url?

The web view is:
property webVIEW : missing value
The HTML box is
property HTMLBOX : missing value

Also how would you use the same properties above to search from a search provider such as google or yahoo?

You’d get the URL from and use something like setMainFrameURL_(theURL)

to search google use this url:

where searchString is just that.

If you want to be a bit more carefull you should “%20” encode the spaces in your searchString

so that “applescript and google searching” becomes “applescript%20and%20google%20searching”

which you can use the following handler, but its mainly a couple lines of text item delmiters:

For other search engines its usually just a matter of running a search with them and looking at the URL of the page they load after searching.

You can also use the NSString method stringByAddingPercentEscapesUsingEncoding:, which should escape all illegal characters.

much better. I’m starting to see the the light of ASOC

Ok this is what I have:

on searchHTML_(sender)
	set theurl to HTMLBAR's stringValue()
	set theurl to theurl as string
	webWIEW's setMainFrameURL_(theurl)
end searchHTML_

But it doesn’t load the entered url which is this exactly: http://www.youtube.com

In your first message, you said it was called HTMLBOX, not HTMLBAR.

You’ve also misspelt webVIEW as webWIEW.

Lol sorry it was just misspelled, thanks for your help though.

Ok i hav another question how would you get the url of the current page? Like say I click a link on a page and it takes me to another page and the url box doesn’t update so how would I update the url?

You can answer these questions pretty easily by opening Xcode Help and searching for WebView. Just look through the instance methods; that’s what I do.

You’ve seen what setMainFrameURL_ does, so you might start with mainFrameURL…

Wow thanks i didn’t know that!