Ok, I need the finder to open a file. I do not know how to do this. I want it to open the first file whose path name contains “itunes music” and whose exention is “.m4a”
is this possible for the finder to track down a file with these qualifications?
try
get quoted form of (text 1 thru -2 of (POSIX path of (path to home folder)))
do shell script "/usr/bin/open \"`/usr/bin/find '/Users/bruce/Public' -ipath '*iTunes Music*.aiff' | /usr/bin/head -n 1`\""
on error errorMsg number errorNum
display dialog "Error (" & errorNum & "):" & return & return & errorMsg buttons "Cancel" default button 1 with icon caution
end try
try
get quoted form of (text 1 thru -2 of (POSIX path of (path to home folder)))
do shell script "/usr/bin/find " & result & " -ipath '*iTunes Music*.aiff'"
get POSIX file (first paragraph of result)
tell application "Finder" to open result
on error errorMsg number errorNum
display dialog "Error (" & errorNum & "):" & return & return & errorMsg buttons "Cancel" default button 1 with icon caution
end try
get quoted form of (text 1 thru -2 of (POSIX path of (path to home folder)))
do shell script "/usr/bin/find " & result & " -ipath '*iTunes Music*.m4a'"
get POSIX file (first paragraph of result)
tell application "Finder"
open result
end tell