How do you currently have your webView set up to get page URLs? Do you have it connected to an NSTextField via takeStringURLFrom: or are you pushing URLs to it with setMainFrameURL:?
In either case, you'll want to set yourself up as a delegate of a second NSTextField, do something like this when you receive textDidEndEditing: from it:
Then set searchURL to your normal URL bar, possibly passing it to the WebView as well if you have the link between the two going through your own code.
The main observations are merely that you need to:
(i) escape the search string (eg, to turn a space into %20 so that it works in a URL); and
(ii) add http://www.google.com/search?q= to the start to turn it into a Google search URL.
Then just treat that identically to a URL directly entered by the user.
thanks
what i'v been having trouble with is when i try to retrieve the text from the google search bar in the .h file then do the @synthesize in the .m file to put it into this string of code
First (and we really need to sticky this for this forum), if you're going to include cope snippets, please enclose them in [ CODE ][ /CODE ] tags (spaces removed). These tags are easily accessed via the # icon in the toolbar.