Hi guys,
I’m an italian user. So, sorry for my bad english.
I wrote AppleScript to find, thanks to dialog box, folders by entered name in first opened window, but I don’t know how can I hide folders without specific string and visualize folders with string.
Can you help me?
Thanks a lot
try
tell application "Finder" to set the source_folder to (folder of the front window) as alias
on error -- no open folder windows
set the source_folder to path to desktop folder as alias
end try
set contatore to "0"
repeat
display dialog "Inserisci la stringa di testo da cercare:" default answer "" buttons {"Annulla", "OK"} default button 2
set the search_string to the text returned of the result
if the search_string is not "" then exit repeat
end repeat
set the item_list to list folder source_folder without invisibles
set source_folder to source_folder as string
repeat with i from 1 to number of items in the item_list
set this_item to item i of the item_list
set this_item to (source_folder & this_item) as alias
set this_info to info for this_item
set the current_name to the name of this_info
if the current_name contains the search_string then
set contatore to contatore + 1
-- Routine di visualizzazione
-- set this_item to not visible
-- set end of item_list to current_name as list
set this_item to false
beep
end if
end repeat
tell application "Finder" to display dialog "Sono state trovate " & contatore & " cartelle" buttons {"OK"} default button 1
Model: G5
AppleScript: 2.1.1
Browser: Firefox 1.5.0.12
Operating System: Mac OS X (10.4)