Writing Files in StandAlone on Mac
Posted: Fri Jan 02, 2009 6:53 pm
I have an application that opens a text file and later rewrites it- The standalone seems to work on the PC but not the Mac version. I am developing on a Mac and it works fine in Revolution, just not in the StandAlone.
Instead of putting the contents of the text file that was read into the field "Transcription", it puts the path to the audio file (the previous value of 'it') so the read statement must not be working.
There are no error statements produced.
Does anyone see what is going on here? Thanks.
Code: Select all
set the itemDelimiter to numToChar(47)
put the filename of this stack into P --get current location
Delete the last item of P
Put empty into field "Transcription"
answer file "Choose a file:" -- select an audio file to open
set the filename of Player "MovieScreen" to it
put the last item of it into field "MovieTitle"
Put P & "/DataFiles/" & field "MovieTitle" & ".txt" into TheFileName
-- creates a text file name with the same name as the audio file
open file TheFileName
open file TheFileName for read
read from file TheFileName at 1 until EOF
put it into field "Transcription"
close file TheFileName
There are no error statements produced.
Does anyone see what is going on here? Thanks.