one liner needed to filter file list
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
one liner needed to filter file list
put the files into field "Template List" puts ALL the files in the current folder into the list.
I would prefer to show ONLY the file names in that folder that contain the word "Template" or "template"
I could of course do a subsequent filtering of the full list to achieve just the names with template in them, but is there a simple one liner that does this?
This does not seem to work filter lines (1 to number of lines) of TempList matching "Template" into field "Template List" it also has to have an additional variable to filter from.
Any ideas?
It must be compatible with Android and windows.
Thank you.
I would prefer to show ONLY the file names in that folder that contain the word "Template" or "template"
I could of course do a subsequent filtering of the full list to achieve just the names with template in them, but is there a simple one liner that does this?
This does not seem to work filter lines (1 to number of lines) of TempList matching "Template" into field "Template List" it also has to have an additional variable to filter from.
Any ideas?
It must be compatible with Android and windows.
Thank you.
Re: one liner needed to filter file list
Code: Select all
...
put files(path/to/folder) into tFiles
filter tFiles with "*template*"
put tFiles into fld "the field with the templates"
...
Hint: Android does not let you access files and folder outside of your APK!It must be compatible with Android and windows.
Re: one liner needed to filter file list
Thank you for the solution, Klaus.
When you say, "outside the APK", if I keep all data in the same folder as the APK or the installed program, will this be OK?
Several years ago, I created an Android app in Livecode and the data file and settings were in the same folder. It worked, so I suppose this will too.
Not that it is relevant to me right now, I wonder how commercial apps access different android folders?
When you say, "outside the APK", if I keep all data in the same folder as the APK or the installed program, will this be OK?
Several years ago, I created an Android app in Livecode and the data file and settings were in the same folder. It worked, so I suppose this will too.
Not that it is relevant to me right now, I wonder how commercial apps access different android folders?
Re: one liner needed to filter file list
Yes, since the APK is in fact also a folder, we can access everything inside this folder like all files and foldersajperks wrote: ↑Tue Oct 26, 2021 11:17 amWhen you say, "outside the APK", if I keep all data in the same folder as the APK or the installed program, will this be OK?
Several years ago, I created an Android app in Livecode and the data file and settings were in the same folder. It worked, so I suppose this will too.
we have added to our runtime via the "Copy files..." tab in the "Standalone Appliction Settings"
We find them in our standalone in -> specialfolderpath("resources") on EVERY platform and even in the IDE.
But we do not have write permissions here, we need to copy files that will be modified to -> specialfolderpath("documents")
which is also a part of our APK, but we have write permission here!
I have no idea, but we cannot do this with LC.
Re: one liner needed to filter file list
Presumably this is done by an API rather than direct access of special folders? In which case probably could be done via some kind of external with LC? (Just speculating, I really have no idea…)
Re: one liner needed to filter file list
Thank you all and I appreciate the help.