View Single Post
  #19  
Old March 24th, 2009, 03:21 PM
Mikuro's Avatar
Mikuro Mikuro is offline
Crotchety UI Nitpicker
 
Join Date: Mar 2005
Posts: 2,682
Thanks: 6
Thanked 53 Times in 48 Posts
Mikuro will become famous soon enough
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
__________________
Mac mini — 1.25GHz G4, 1GB RAM — OS 10.5.8

Useful programs: Privoxy, Butler, ffmpegX, VLC, Perian, Tofu, Wcalc
Reply With Quote