Hi
I have this script which uses “Finder” to troll through a mounted volume looking for files starting with or ending with certain names etc, the mounted volume that the finder has to search through has hundreds of files and folders in it and the finder takes such a long time to trudge through the finding process, Im sure using a shell command to find, list etc would be 10x faster than what I am using, problem is I don’t no unix.
Could I get some advice on how to implement unix, using do shell script, to replace the finder in this script, to make it faster please
on clicked theObject
------------------------------------------
if name of theObject is “SK_KNIVES” then
set _path to “KNIFE DRAWINGS:”
tell application “Finder”
set _list to (name of every file of entire contents of folder _path whose name starts with “SK”) as alias list
end tell
tell window “main”
delete every menu item of menu of popup button “_itemlist”
repeat with each_Item in _list
make new menu item at the end of menu items of menu of popup button “_itemlist” with properties {name:each_Item, title:each_Item, enabled:true}
end repeat
end tell
------------------------------------------
else if name of theObject is “VK_KNIVES” then
set _path to “KNIFE DRAWINGS:”
tell application “Finder”
set _list to (name of every file of entire contents of folder _path whose name starts with “VK”) as alias list
end tell
tell window “main”
delete every menu item of menu of popup button “_itemlist”
repeat with each_Item in _list
make new menu item at the end of menu items of menu of popup button “_itemlist” with properties {name:each_Item, title:each_Item, enabled:true}
end repeat
end tell
------------------------------------------
else if name of theObject is “_Illustrator” then
set _path to “KNIFE DRAWINGS:”
tell application “Finder”
set _list to (name of every file of entire contents of folder _path whose name ends with “.ai”) as alias list
end tell
tell window “main”
delete every menu item of menu of popup button “_itemlist”
repeat with each_Item in _list
make new menu item at the end of menu items of menu of popup button “_itemlist” with properties {name:each_Item, title:each_Item, enabled:true}
end repeat
end tell
------------------------------------------
else if name of theObject is “_select” then
tell application “Finder”
set theFile to (choose folder without invisibles)
set _list to (name of every file of entire contents of folder theFile)
end tell
tell window “main”
delete every menu item of menu of popup button “_itemlist”
repeat with each_Item in _list
make new menu item at the end of menu items of menu of popup button “_itemlist” with properties {name:each_Item, title:each_Item, enabled:true}
end repeat
end tell
end if
------------------------------------------
if name of theObject is “get” then
set _path to “KNIFE DRAWINGS:”
set _selecteditem to title of current menu item of popup button “_itemlist” of window “main” as text
tell application “Finder” to set FileToOpen to ((get 1st file of entire contents of folder _path whose name is _selecteditem) as alias)
tell application “Adobe Illustrator” to open FileToOpen
end if
------------------------------------------
if name of theObject is “cancel” then
quit me
end if
------------------------------------------
end clicked
Cheers
Budgie