I know that this has been discussed at length, but despite my best efforts, I can't seem to figure it out.
I want to read and write a simple text file to and from a card field. I know that if I use the "documents" folder, iTunes will back it up during sync. That's cool. So I used this code, which works just great on the Mac and iOS:
Code: Select all
on writeScores
set the defaultFolder to specialFolderPath("documents")
put field "scores" of card "Main" into URL ("file:scores.txt")
end writeScores
on readScores
set the defaultFolder to specialFolderPath("documents")
put URL ("file:scores.txt") into field "scores" of card "Main"
end readScores
As an attempt to try to track things down, I used the line:
answer the defaultFolder
to which I received:
/data/data/com.yourcompany.yourapp/files
That confused me - not at all what I expected. Is this because I'm running on the simulator, or am I fundamentally doing something wrong? I'd be grateful for any feedback you could offer.
Peace.
Joel