Applescript problem

Discussion in 'Mac Programming' started by DouglasMcKibbin, Dec 2, 2007.

  1. DouglasMcKibbin macrumors newbie

    Joined:
    Dec 2, 2007
    #1
    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.
     
  2. Sayer macrumors 6502a

    Sayer

    Joined:
    Jan 4, 2002
    Location:
    Austin, TX
    #2
    Ironically what you wrote is almost exactly what you use e.g.

    Code:
    get every item in desktop whose name begins with "TNV"
    Here is a working script:

    Code:
    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
     

Share This Page