Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.5: Switch search locations via keyboard shortcut' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Switch search locations via keyboard shortcut
Authored by: NovaScotian on May 16, '08 02:38:22PM
I search a rather large Scripts folder fairly often for bits and pieces, but this script could be easily modified to search anywhere:
tell application "Finder"
	activate
	set {Btn, toFind} to {button returned, text returned} of (display dialog "Enter the word(s) to find in Scripts." default answer "" buttons {"Cancel", "In Content", "In File Name"} default button "In Content" with icon 1) -- will find File names from "In Content".
	open (path to scripts folder from user domain)
end tell
-- Now GUI script that window for a search.
delay 0.5 -- wait for the Finder to get on with it.
tell application "System Events" to tell process "Finder"
	set value of text field 1 of group 1 of tool bar 1 of window "Scripts" to toFind
	delay 0.5 -- wait for Sys Events to get to the right place before clicking.
	click radio button 2 of radio group 1 of group 1 of group 1 of splitter group 1 of window 1
	if Btn contains "File" then click radio button 2 of radio group 2 of group 1 of group 1 of splitter group 1 of window 1
end tell


[ Reply to This | # ]