new "documents" path works on simulator, not on device
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
new "documents" path works on simulator, not on device
I find that using just "documents" rather than SpecialFolderPath("documents"), as introduced in LiveCode 5.0.2, works with no problems in the simulator but not on the iPad. Can be shown in the following bits of code:
button Store
on mouseUp
set the defaultfolder to "documents"
if there is no folder "myData" then
create folder "myData"
end if
if there is no folder "myData/subFolder" then
create folder "myData/subFolder"
end if
put field "dataInput" into url("file:myData/subFolder/store.txt")
end mouseUp
button Retrieve
on mouseUp
set the defaultFolder to "documents"
put url("file:myData/subFolder/store.txt") into field "dataOutput"
end mouseUp
On the simulator it all happens as expected. On the iPad nothing happens. When I set file sharing on in the app, iTunes shows that the folders are not created with the "documents" version, but they are created with the SpecialFolderPath("documents") version.
It's not a big deal as I can continue using the old method, but it seems that something is going wrong.
Has anyone else come across this?
Cheers
Don
button Store
on mouseUp
set the defaultfolder to "documents"
if there is no folder "myData" then
create folder "myData"
end if
if there is no folder "myData/subFolder" then
create folder "myData/subFolder"
end if
put field "dataInput" into url("file:myData/subFolder/store.txt")
end mouseUp
button Retrieve
on mouseUp
set the defaultFolder to "documents"
put url("file:myData/subFolder/store.txt") into field "dataOutput"
end mouseUp
On the simulator it all happens as expected. On the iPad nothing happens. When I set file sharing on in the app, iTunes shows that the folders are not created with the "documents" version, but they are created with the SpecialFolderPath("documents") version.
It's not a big deal as I can continue using the old method, but it seems that something is going wrong.
Has anyone else come across this?
Cheers
Don
Re: new "documents" path works on simulator, not on device
Hi Don,
why use an "inofficial" syntax and tempt fate?
Maybe this works for you (sometimes) but don't rely on it!
Best
Klaus
why use an "inofficial" syntax and tempt fate?

Maybe this works for you (sometimes) but don't rely on it!
Best
Klaus
Re: new "documents" path works on simulator, not on device
Hi Klaus
The new folder equivalents are documented on page 11 of the 5.0.2 Release Notes. It says nothing about them being unofficial so why would you not expect to confidently use them?
Cheers
Don
The new folder equivalents are documented on page 11 of the 5.0.2 Release Notes. It says nothing about them being unofficial so why would you not expect to confidently use them?
Cheers
Don
Re: new "documents" path works on simulator, not on device
Hi Don,
it says
documents folder
not "documents", especially not enclosed in quotes which makes it a literal.
try this in a button and a card with one field
actually I had not read that part of the Release Notes. It is a lot easier. Thank you.
Kind regards
Bernd
it says
documents folder
not "documents", especially not enclosed in quotes which makes it a literal.
try this in a button and a card with one field
Code: Select all
on mouseUp
put the defaultFolder into tOldDefault
put the defaultFolder into field 1
set the defaultFolder to "documents" -- does not work
put the defaultFolder into line 2 of field 1
set the defaultFolder to the documents folder
put the defaultFolder into line 3 of field 1
set the defaultFolder to tOldDefault
end mouseUp
Kind regards
Bernd
Re: new "documents" path works on simulator, not on device
Thanks Klaus
But I don't understand how my wrong code does actually work on the simulator. Anyway, all is well.
Cheers
Don
But I don't understand how my wrong code does actually work on the simulator. Anyway, all is well.
Cheers
Don
Re: new "documents" path works on simulator, not on device
Hi Don,
my pleasure, but that was Bernd!
I know that we germans all look alike to you aussies...
Best
Klaus
my pleasure, but that was Bernd!
I know that we germans all look alike to you aussies...

Best
Klaus
Re: new "documents" path works on simulator, not on device
The simulator and a device work differently because they use different folder constructs. On the simulator, a real path to a real folder on your hard drive is used. On a device, the folders are "virtual" -- they don't really exist. The engine does some fancy translations so that your scripts act as though a folder was there, but really they aren't.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: new "documents" path works on simulator, not on device
Sorry Bernd
I didn't read the signature on your post. Actually, even as an Aussie I can distinguish among Germans because I have a German son-in-law and a German daughter-in-law and we spent a month in your country last year. We really enjoyed it.
Cheers
Don
I didn't read the signature on your post. Actually, even as an Aussie I can distinguish among Germans because I have a German son-in-law and a German daughter-in-law and we spent a month in your country last year. We really enjoyed it.

Cheers
Don
Re: new "documents" path works on simulator, not on device
Hi Don,
no problem.
A couple of years ago I went to Melbourne and really liked it there. Though 22 hours on the plane were long...
Kind regards
Bernd
no problem.
A couple of years ago I went to Melbourne and really liked it there. Though 22 hours on the plane were long...
Kind regards
Bernd