Adressing of files to included folders in standalone
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Adressing of files to included folders in standalone
In a standalone with a selected "move substacks to individual files", permitting user to accumulate data in substacks , I found the option to include folders, and have thus included two named but empty folders meant to accumulate A) html files ( from parsings) and B) jpg files (from screenshots).
However I find no indication how to script the adressing of files to such folders in the relevant handlers.
However I find no indication how to script the adressing of files to such folders in the relevant handlers.
Re: Adressing of files to included folders in standalone
Hi Kresten,
you will find everything later in your standalone here -> specialfolderpath("resources")
But be aware that only users with ADMIN permissions are allowed to write (save files in these folders) in the "Applications/Program files)" folder on the appropriate platforms!
So maybe you want to create and use (fill with files) your folder(s) in -> specialfolderpath("documents")
Best
Klaus
you will find everything later in your standalone here -> specialfolderpath("resources")
But be aware that only users with ADMIN permissions are allowed to write (save files in these folders) in the "Applications/Program files)" folder on the appropriate platforms!
So maybe you want to create and use (fill with files) your folder(s) in -> specialfolderpath("documents")
Best
Klaus
Re: Adressing of files to included folders in standalone
Hi Klaus
My application is freeware, so ADMIN permission should be implicit.
I am a little unsure about your use of the term "resources"
Does this just mean that my line
open file destination &"/"& parsings &"/"& filename (in the LC environment)
shall be
open file specialfolderpath("parsings")&"/"& filename (in the standalone) ???
My application is freeware, so ADMIN permission should be implicit.
I am a little unsure about your use of the term "resources"
Does this just mean that my line
open file destination &"/"& parsings &"/"& filename (in the LC environment)
shall be
open file specialfolderpath("parsings")&"/"& filename (in the standalone) ???
Re: Adressing of files to included folders in standalone
Heya Kresten
I think you misunderstood Klaus's statement, the permission he is describing has nothing to do with your program, per se, but with the structure of the underlying Operating System.
No matter which OS you use, you have a series of folders in the file system. Some, like 'Documents', 'Home', 'Desktop' and the like, are accessible to whomever is in the seat.
Other folders and files, usually pertaining to the OS itself, are only (readily) accessible to those with 'Administration' permissions attached to their account.
For example, if you wanted to edit the sources list in Linux (or really, any file below the Home folder), you would have to elevate your base user to "su", either temporarily using "sudo", or more permanently using "su", or login as "root", which is the top user.
Hopefully that clarifies Klaus's statement a bit
Re: Adressing of files to included folders in standalone
Thanks to both of you.
"So maybe you want to create and use (fill with files) your folder(s) in -> specialfolderpath("documents")"
Yes, apparently necessary !
But I am afraid I need detailed help in following this advice.
Optimally the standalone shall create a folder "Phenomenalog" containing a) folder "Parsings", b) folder "Snapshots" and c) a file "Diarysum.html"
How do I achieve this?
And if/when achieved how will I address these folder and this html file in the relevant handlers ?
"So maybe you want to create and use (fill with files) your folder(s) in -> specialfolderpath("documents")"
Yes, apparently necessary !
But I am afraid I need detailed help in following this advice.
Optimally the standalone shall create a folder "Phenomenalog" containing a) folder "Parsings", b) folder "Snapshots" and c) a file "Diarysum.html"
How do I achieve this?
And if/when achieved how will I address these folder and this html file in the relevant handlers ?
-
- VIP Livecode Opensource Backer
- Posts: 9670
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Adressing of files to included folders in standalone
Hi.
Would not the "create folder" and "open file" commands do the trick?
Craig
Would not the "create folder" and "open file" commands do the trick?
Craig
Re: Adressing of files to included folders in standalone
Hi Kresten,
everything you add via the "Copy files" tab in the "Standlone Application Settings" for your standalone you will find here in the standalone -> specialfolderpath("resources")
So add your HTML file here and then do this on pre-/openstack/-card
Now you can adresse you folder and files with:
Get the picture?
Best
Klaus
everything you add via the "Copy files" tab in the "Standlone Application Settings" for your standalone you will find here in the standalone -> specialfolderpath("resources")
So add your HTML file here and then do this on pre-/openstack/-card
Code: Select all
...
## Check if we need to create folder(s)
put specialfolderpath("documents") & "/Phenomenalog" into tFolder1
put specialfolderpath("documents") & "/Phenomenalog/Parsings" into tFolder2
put specialfolderpath("documents") & "/Phenomenalog/Snapshots" into tFolder3
if there is not a folder tFolder1 then
create folder tFolder1
end if
## Same for tFolder2 and tFolder3
## Now copy the HTML file from resources folder to docs folder if neccessary:
put specialfolderpath("resources") & "/Diarysum.html" into tSourceFile
put specialfolderpath("documents") & "/Phenomenalog/Diarysum.html" into tTargetFile
if there is not a file tTargetFile then
put url("file:" & tSourceFile) into url("file:" & tTargetfile)
end if
...
Code: Select all
...
put specialfolderpath("documents") & "/Phenomenalog" into tPhenomenalogFolder
put specialfolderpath("documents") & "/Phenomenalog/Parsings" into tParsingsFolder
put specialfolderpath("documents") & "/Phenomenalog/Snapshots" into tSnapShotFolder
...
put specialfolderpath("documents") & "/Phenomenalog/Diarysum.html" into tHTMLFile
...
Best
Klaus