It looks like the script goes on to test search_parameter. My guess is you should say
set the search_parameter to "Both". But there's probably a simpler way to do this by editing the later part of the script so that it just does what you want and doesn't bother testing search_parameter (assuming you're not using the option to search only folder or only file names).
As for the Safari question, this is more complicated. The only way I know of doing it is to tell Safari to execute a bit of JavaScript. So the first thing to do is to figure out how to push that button with JavaScript, and then send that JavaScript snippet to Safari via AppleScript. I have a simple example of this somewhere, let me see if I can find it....
Here we go:
Code:
tell application "Safari"
do JavaScript "
function x() {
return document.title
}
x();
" in tab 1 of window 1
end tell
That will pull the title of the active web page into your script.
I think there's a submit() method of either buttons or forms (or both) that will do what you need, but the trickier part is finding the right form button through the script. I'm not an expert with JavaScript, so I can only point you in the right direction. It's not a simple topic. If you're really interested, check out
http://www.w3schools.com/js/js_obj_htmldom.asp