views:

1683

answers:

1

I have a compiled applescript application which I have moved to my windows server. I'd like to then insert a text file into the application (which looks like a zip file on windows):

myapplescript.app/Contents/Resources/MyNewDir/MyTxtFile.txt

So, i've precompiled the applescript to try to read from this text file and get the contents as a string. This is what I do:

set theFolder to POSIX path of (the path to me)
set theFile to theFolder & "Contents/Resources/MyNewDir/MyTxtFile.txt"
open for access theFile
set fileContents to (read theFile)
close access theFile

And this is the error I get:

Can't make "/Users/mike/Desktop/myapplescript.app/Contents/Resources/MyNewDir/MyTxtFile.txt" into type file

+1  A: 

Ok, I figured it out, I changed the second line to this:

set theFile to (POSIX file (theFolder & "Contents/Resources/MyNewDir/MyTxtFile.txt"))
Mike Blandford