Hi, I am trying to write a script which will search a server in multiple folder locations for files which have certain extensions and characters. (Ie. I need to search for a file named: R FPTR 9488-1.pdf or similar.) Then having compiled this list to display and give me the option to paste it into a word file (the script must create this new word file).
I have searched and searched online including in this forum. I am new to scripting and want to learn. I have written the script below and using event logger in script editor I get this output:
tell current application
choose folder with multiple selections allowed without invisibles
{alias "Macintosh HD:Users:corin:Documents:JJL:PDF's and logos JJL:"}
path to desktop as alias
alias "Macintosh HD:Users:corin:Desktop:"
end tell
tell application "Finder"
get every file of entire contents of alias "Macintosh HD:Users:corin:Desktop:" whose name extension contains "pdf -doc" and name starts with "FPTR -TR -FR"
{}
"Can't make \"\" into type alias."
Any ideas?
try
set report_folder to choose folder with multiple selections allowed without invisibles
set the report_folder to path to desktop folder as alias
end try
tell application "Finder"
{files of entire contents of report_folder whose name extension contains "pdf -doc" and name starts with "FPTR -TR -FR"}
end tell
set search_result to result as string
set file_list to result as alias
tell application "/Applications/Microsoft Office 2004/Microsoft Word"
activate
open file_list
end tell
Model: Mac Book Pro Intel G4
AppleScript: 2.2.1 (100.1)
Browser: Firefox 3.0.4
Operating System: Mac OS X (10.5)