Problem with updating HTML files in LiveCode
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Problem with updating HTML files in LiveCode
Again,
"the files" used with a repeat loop.
Show me what you have tried.
Simon
"the files" used with a repeat loop.
Show me what you have tried.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Problem with updating HTML files in LiveCode
This might be of help: you zip the folder and then copy it from the engine to the device and unzip it.
Someone's done something similar:
http://mail.runrev.com/forums/viewtopic ... 137#p69829
Gerry
Someone's done something similar:
http://mail.runrev.com/forums/viewtopic ... 137#p69829
Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
Re: Problem with updating HTML files in LiveCode
Code: Select all
repeat with n = 1 to 11
put (specialFolderPath("engine") & "/Content/p"&n&".html") into filePath
put url ("binfile:" & filePath) into destFilePath
put destFilePath into url ("binfile:"& (specialFolderPath("Documents") & "/Contents/p"&n&".html"))
end repeat
Re: Problem with updating HTML files in LiveCode
Code: Select all
repeat with n = 1 to 11
put (specialFolderPath("engine") & "/Content/p"&n&".html") into filePath
put url ("binfile:" & filePath) into destFilePath
put destFilePath into url ("binfile:"& (specialFolderPath("Documents") & "/Contents/p"&n&".html"))
end repeat
Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
Re: Problem with updating HTML files in LiveCode
Because in the engine folder the folder is named "Content" and in the Documents folder it's named as "Contents"
Re: Problem with updating HTML files in LiveCode
html files are not binary files, so just "file:"
Images are "binfiles:"
also
put the files into tLotsOfFiles
repeat with x = 1 to the number of lines in tLotsOfFiles
put line x of tLotsOfFiles into tFileName
Now can you see how to use tFileName to copy the files?
Simon
Images are "binfiles:"
also
put the files into tLotsOfFiles
repeat with x = 1 to the number of lines in tLotsOfFiles
put line x of tLotsOfFiles into tFileName
Now can you see how to use tFileName to copy the files?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Problem with updating HTML files in LiveCode
I guess, I'll do it with the zip portion. Should be able to work fine for me. (: I will try it now. Thanks to all of you, Klaus, Simon and Gerry! 
Jeremy

Jeremy
Re: Problem with updating HTML files in LiveCode
Not sure about your codes here but I tried doing the codes here.Simon wrote:html files are not binary files, so just "file:"
Images are "binfiles:"
also
put the files into tLotsOfFiles
repeat with x = 1 to the number of lines in tLotsOfFiles
put line x of tLotsOfFiles into tFileName
Now can you see how to use tFileName to copy the files?
Simon
I have copied the files "Content.zip" to get all my files over there but it seems that the zip file shows "0 bytes", which means it doesn't have any files in it. And also I am unclear of the unzipping of the file part. Help please? Thanks!
##Edit Got the zip file into the documents folder. But I am unable to unzip all the files using the code given from the codes below. I did not use the downloadFiles and changed the path to Content.zip. It doesn't do anything. Help?
Jeremy
Code: Select all
on downloadFiles
libUrlDownloadToFile "URL TO ZIP", specialfolderpath ("documents") & "/imagesApp.zip"
send unZip to me in 0 milliseconds
end downloadFiles
command unZip
put specialFolderPath("documents") & "/imagesApp.zip" into TempFile
put specialFolderPath("documents") & "/" into TargetFile -- Problem part, previous one was linked to a map in a map, because the zip is a map.
revZipOpenArchive TempFile, "read"
put RevZipEnumerateItems(TempFile) into tList
repeat for each line i in tList
if i = empty then
next repeat
end if
revZipExtractItemToFile TempFile, i, (TargetFile & i)
end repeat
revZipCloseArchive TempFile
delete file TempFile
end unZip
Last edited by TKYTKY on Thu Dec 05, 2013 6:55 am, edited 1 time in total.
Re: Problem with updating HTML files in LiveCode
Did you read the full thread?
Simon
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Problem with updating HTML files in LiveCode
Yes I downloaded the file you used and substituted the codes I needed to unzip the folders into the documents folder. It still doesn't work.
This is my code. I put it into a button and when I answer it, it shows that everything is empty.
##Edit : Code is edited for this post and, I don't understand what this code means " revZipExtractItemToFile TempFile, i, (TargetFile & i)"
### Edit : Again
Code: Select all
on mouseUp
if the environment = "development" then touchEnd 1
send unZip to me in 0 milliseconds
end mouseUp
command unZip
put specialFolderPath("documents") & "/Content.zip" into TempFile
answer it
put specialFolderPath("documents") & "/" into TargetFile
answer it
revZipOpenArchive TempFile, "read"
answer it
put RevZipEnumerateItems(TempFile) into tList
answer it
repeat for each line i in tList
if i = empty then
next repeat
end if
--HERE IS THE FOLDER CODE
if the last char of i ="/" then
create folder (TargetFile & i)
next repeat
end if
--END
revZipExtractItemToFile TempFile, i, (TargetFile & i)
end repeat
revZipCloseArchive TempFile
delete file TempFile
end unZip
##Edit : Code is edited for this post and, I don't understand what this code means " revZipExtractItemToFile TempFile, i, (TargetFile & i)"
### Edit : Again
Last edited by TKYTKY on Thu Dec 05, 2013 7:17 am, edited 2 times in total.
Re: Problem with updating HTML files in LiveCode
I don't see an "answer it" anywhere in your code?when I answer it, it shows that everything is empty
Are you trying to learn liveCode or just pass a class?
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Problem with updating HTML files in LiveCode
Just edited it again.
And does the code "send unzip to me in 0 milliseconds" actually does the command "unZip"? :O
## Edit: As seen, I have 4 "answer it". But I only got 2 answers which are blank.
Thanks
Jeremy
And does the code "send unzip to me in 0 milliseconds" actually does the command "unZip"? :O
## Edit: As seen, I have 4 "answer it". But I only got 2 answers which are blank.
Thanks
Jeremy
Re: Problem with updating HTML files in LiveCode
Oh ya and there are three folders in my Content.zip now already named "JS", "Images" and "Style" only. Is it possible to extract all three of them at once into the names they should be to the documents folder from the engine folder?
##Edit : Tried answering them one by one on top, only tList isn't answered. The rest were answered correctly.
##Edit : Tried answering them one by one on top, only tList isn't answered. The rest were answered correctly.
Re: Problem with updating HTML files in LiveCode
Have you studied "it" and "result"?
Do you know when to use either?
Do you know when to use either?
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Problem with updating HTML files in LiveCode
I tried "answer the result" and "answer result" and "result" but it doesn't work
I used the dictionary to find "result" but don't get what it does and except check for errors but it doesn't tell me what errors there are too.
I used the dictionary to find "result" but don't get what it does and except check for errors but it doesn't tell me what errors there are too.