I'm on Mac OS X 10.11.2 and do have problems with AppleScript and the shell scripting.
The following script is a cut-out from a larger project:
tell application "Finder"
set the_MePath to (path to me)
set the_MeCont to (container of the_MePath) as string
end tell
set the_MeContShell to (text 1 thru -2) of the_MeCont
--normaly not there!
set the_MePara to (the_MeCont & "STH-C Para WAV_48k_24.txt")
set the_Parameters to (open for access file the_MePara with write permission)
write ("WAV\r24\r48000\r48k\r") to the_Parameters
close access the_Parameters
--normaly not there!
--intended to be there!
--set the_MePara to (do shell script "find " & quoted form of POSIX path of the_MeContShell & " -iname 'STH-C Para *'")
set the_Parameters to (open for access file the_MePara)
set the_ParaList to (read file the_MePara)
close access the_Parameters
set userFormat to paragraph 1 of the_ParaList
set userBitDepth to paragraph 2 of the_ParaList
set userSampleRate to paragraph 3 of the_ParaList
set shortSampleRate to paragraph 4 of the_ParaList
The lines between the "--normaly not there!"-lines fills a file in the AppleScript's directory with data.
So, now the file is there.
If I delete these lines and activate the line below "--intended to be there!", the shell should find this file.
What I get then, is an error:
error "Fehler beim Zugriff auf das Netzwerk." number -5000 from file "/Users/Shared/_AppleScript Development/_Archiv Sniplets/STH-C Para WAV_48k_24.txt" to «class fsrf»
at "open for access file the_MePara".