hey guys. this worked fine in 10.5, but 10.6 is returning an error:
“error “System Events got an error: Can’t get text field 1 of group 1 of tool bar 1 of window "Art_Server" of process "Finder". Invalid index.” number -1719 from text field 1 of group 1 of tool bar 1 of window “Art_Server” of process “Finder””
… any ideas?
tell application "Finder"
activate
set {Btn, toFind} to {button returned, text returned} of (display dialog "Enter your search term for the Art Server." default answer "" buttons {"Cancel", "In Content", "In File Name"} default button "In Content" with icon 1)
open folder "Art_Server"
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 "Art_Server" 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
delay 0.5 -- wait for Sys Events to get to the right place before clicking.
tell application "System Events" to keystroke tab using shift down
end tell
maybe now theres a better method, anyway?
let me know! thanks again.
-jordan