PDA

View Full Version : Applescript problem




DouglasMcKibbin
Dec 2, 2007, 03:46 PM
How can I write a simple Boolean expression for an if/then statement that tests whether or not there is a file on the desktop whose filename begins with "TNV", There appears to be no wildcard character in applescript.



Sayer
Dec 2, 2007, 04:39 PM
Ironically what you wrote is almost exactly what you use e.g.

get every item in desktop whose name begins with "TNV"

Here is a working script:

tell application "Finder"
set fileList to (get every item in desktop whose name begins with "TNV")
if length of fileList > 0 then beep 2

end tell