Newbie needs to find file

I need to find a file using Applescript. Applescript is so slow. Someone on the Apple forums gave me some unix code and it works for the most part. The ls command is really list and not find but when it works, it returns the path to the file instantly, NOT 45 seconds Applescript takes.

here is the path to the folder:

/volumes/DW/700Club/AVSHEET/WorldReach now CBN International/AFRICA/

here is the name of the file:
AFRICA1 Faso, Burkina.doc

here is the shell script I am using that does not work:
text_returned is the result of a dialog box, in this example its AFRICA1

set the_AVSheet to (do shell script "ls '/volumes/DW/700Club/AVSHEET/WorldReach now CBN International/AFRICA/" & text_returned & "' '*")

can anyone help me get this to work with either ls or a find command. Thank you very much.

I am an audio post engineer who searches a dozen servers for the file I need and write code to help me find the file instead of me clicking 50 times through a folder structure that is brutal. Thanks for any help.

to start with:

find '/volumes/DW/700Club/AVSHEET/WorldReach now CBN International/AFRICA' -type f -name '*Burkina*'

this is how we work. This is the file name:
AFRICA1 Faso, Burkina.doc

We just refer to the project or file as AFRICA1. The rest of the file name sometimes it too hard to remember or pronounce. So in Applescript I use a dialog box to have the user enter the project code (AFRICA1) and I use that info in searching for the file in the folder. I hope that all makes sense. Maybe if I replace "*Burkina" with the variable text_returned that will work.

replace '*Burkina*' by 'AFRICA1*' in the find command given in post#2

I tried this but Applescript will not compile it.

set the_AVSheet to (do shell script "find '/volumes/DW/700Club/AVSHEET/WorldReach now CBN International/AFRICA' -type f -name '*Burkina*'"

---------- Post updated at 10:26 AM ---------- Previous update was at 10:25 AM ----------

this does not work

find '/volumes/DW/700Club/AVSHEET/WorldReach now CBN International/AFRICA' -type f -name '*AFRICA1*'

no star in front of A...

I'll fix that but do I need to put do shell script in front of the find command and do I need to put quotes before find and after the last character of the command line. thanks

Unfortunately I have a mac at home... but since I work on true unix boxes even at home I use ksh and standard scripts with my mac... You will have to wait I leave work to see what you mean by trying to test on my macbook...

I tried this and it does not work either.

set the_AVSheet to do shell script "find -AFRICA2 /volumes/DW/700Club/AVSHEET/WorldReach now CBN International/AFRICA/"

---------- Post updated at 02:21 PM ---------- Previous update was at 12:50 PM ----------

this works:

set the_AVSheet to do shell script "find '/volumes/DW/700Club/AVSHEET/WorldReach now CBN International/AFRICA' -type f -name '*Burkina*'"

---------- Post updated at 02:22 PM ---------- Previous update was at 02:21 PM ----------

anything I do to replace Burkina with the variable text_returned does not return any kind of information.

what's 'text_returned'? What's its value? And you incorporate into the 'find' script?

when the user runs the script, a dialog box opens so you can input the 1st part of the filename. i.e. AFRICA123. Its a variable. The path to the folder is pre-determined, you just have to find the AFRICA123 file.

the code below shows the folder path and then the 1st word of the filename for which you are searching.

set the_AVSheet to do shell script "find '/volumes/macintosh HD/Users/shawn/Desktop/Worldreach/AFRICA/' -type f -name & text_returned & " *"

I'm afraid I cannot help with the Applescript - hopefully vbe will be back on this thread.