tell application "Finder" set sel to selection repeat with theFile in sel -- if name extension of theFile is "aip" then if text -3 thru -1 of (name of theFile as text) is "aip" then set myFileName to name of theFile