This snippet taken from a larger script was kindly put together by StefanK, it searches for a specific file name that is entered via a text field ending with the extension .ps , works flawlessly, what I want to do though is have it search at the same time for files ending in .pdf is this possible with this set up?, if so how can it be done please?’
I tried something like
set Fileext to {"ps", "pdf"}
didnt seem to work.
set Fileext to "ps"
set Filename to STDFILE's stringValue()
set _selecteditem to (Filename as string)
set GOgETiT to "mdfind -onlyin '/Volumes/RIP FILES/' 'kMDItemDisplayName == " & quote & Filename & "*" & quote & "wc" & " && (kMDItemFSName == " & quote & "*." & Fileext & quote & ")'"
set foundfFiles to paragraphs of (do shell script GOgETiT)
set FileToOpen to first item of foundfFiles
tell application "System Events" to tell disk item FileToOpen
set {tName, tEx} to {name, name extension}
end tell
set baseName to text 1 thru ((get offset of "." & tEx in tName) - 1) of tName