Page 1 of 1

get contents file

Posted: Fri Oct 04, 2019 2:08 pm
by link76
I save my map file (map.html) in the special folder to be displayed in the mobile device browser and works perfectly!

I would like to retrieve the contents of the map.html file in my device mobile, so that it can modify it.

Trying this motion I recover only the url of the route.

Code: Select all

set the defaultFolder to specialFolderPath("documents")
put "url:" & defaultfolder & "/map.html" into contentsMapFile
....
replace "aaaaaa," with "bbbb" in contentsMapFile 
thanks

Re: get contents file

Posted: Fri Oct 04, 2019 2:16 pm
by Klaus
1. No need to set the defaultfolder.
2. You forgot the FILE: in the URL function
3. URL is a LC function, so NO quotes here!
Do this:

Code: Select all

...
put URL("file:" & specialFolderPath("documents") & "/map.html") into contentsMapFile
....
replace "aaaaaa," with "bbbb" in contentsMapFile 
...
## Write back if neccessary:
put contentsMapFile into URL("file:" & specialFolderPath("documents") & "/map.html")
...
You will find all this in the dictionary! 8)