Install files to documents folder?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 19
- Joined: Wed Jun 18, 2014 7:23 pm
Install files to documents folder?
Hi I am having a problem with my program. I have a bunch of text documents in my program that I need to write to. They are being installed to specialFolderPath("engine")
however I need them to be installed to specialFolderPath("documents"). Is there a way to achieve this or do I need to write code to move them when the app is launched?
any help i greatly appreciated. Thanks,
however I need them to be installed to specialFolderPath("documents"). Is there a way to achieve this or do I need to write code to move them when the app is launched?
any help i greatly appreciated. Thanks,
Re: Install files to documents folder?
Hi TubooBokBok,
Yes you have to write code.
That should do it. You may have to change binfile to file.
Simon
Well, Yes there is a way to achieve it.Is there a way to achieve this or do I need to write code to move them when the app is launched?
Yes you have to write code.
Code: Select all
put url("binfile:" & specialFolderPath("engine") & "/myDoc.docx") into \
url("binfile:" & specialFolderPath("documents") & "/myDoc.docx")
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 19
- Joined: Wed Jun 18, 2014 7:23 pm
Re: Install files to documents folder?
Ok thanks. And will that code completely move the file or just copy and paste it? why I ask is If that code is run every time the program is run will it overwrite the changes I have made to the files in specialFolderPath("documents")?
Re: Install files to documents folder?
This one you'll have to do some work for.
How would you check if a file is or is not in the documents folder?
Simon
How would you check if a file is or is not in the documents folder?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 19
- Joined: Wed Jun 18, 2014 7:23 pm
Re: Install files to documents folder?
would something like this work?
Code: Select all
put URL ("file:" & specialFolderPath("documents") & slash & "myDoc.txt") into fileCheck
if fileCheck is empty then
put put URL ("file:" & specialFolderPath("engine") & slash & "myDoc.txt") into URL ("file:" & specialFolderPath("documents") & slash & "myDoc.txt")
end if
Re: Install files to documents folder?
I can show you and easier way but first.
Did you know that there is an HTML5 crowdsourcing drive going on now?
http://livecode.com/livecode-to-html5/
Can you contribute?
Simon
Did you know that there is an HTML5 crowdsourcing drive going on now?
http://livecode.com/livecode-to-html5/
Can you contribute?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 19
- Joined: Wed Jun 18, 2014 7:23 pm
Re: Install files to documents folder?
I will see what I can do. although as A 18 year old fresh out of school and looking for a job it wont be anything groundbreaking, but every little helps I suppose. It does look like a awesome addition to Livecode!
Re: Install files to documents folder?
Thank you!!!
OK try,
Thanks again.
Simon
OK try,
Code: Select all
if there is not a file (specialFolderPath("documents") & slash & "myDoc.txt") then
--do the put URL stuff
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Install files to documents folder?
Simon's syntax is 100% correct, but I just wanted to note that you can also write
Mark
Code: Select all
if there is no file...
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode