I am loading sound files into a field and using the 'Play' command but setting the source of the sound files also drags in the DS_Store (invisible on a Mac) and for the life of me I can't get rid of it! I've tried the 'showInvisibles in various locations but to no avail. Screenshot and code attached:
on mouseUp
answer folder "Where are the sound files?"
if it is not empty then
set the defaultFolder to it
end if
put the files into field "playlist"
set the showInvisibles to false
end mouseUp
results in
Annoying ++
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Annoying ++
If we're treading on thin ice, well you might as well dance.
Re: Annoying ++
Ok. So now, without explanation, it works (as in not visible). The only thing that changed was that I moved the sound files to a new location. Weird. I'm leaving the post up though because if anyone else encounters this, the solution may be simply to move the source of the sound iles.
If we're treading on thin ice, well you might as well dance.
-
- VIP Livecode Opensource Backer
- Posts: 9842
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Annoying ++
The showInvisibles property is for controls, not files. See the Dictionary entry:
https://livecode.com/resources/api/#liv ... invisibles
The .DS_Store file is created dynamically by the Finder to store folder-specific view preferences, such as whether list or icon mode, column widths for list mode, rect, etc. If you create a new folder and do not alter its appearance, a .DS_Store file may not be created.
To filter unwanted elements from a list, use the filter command. On macOS and Linux, files beginning with "." are not shown in lists by default, so to exclude those from the list returned from "the files" you could add a line to your handler:
Note that I also added a sort there. File listings obtained from "the files" are returned in whatever form the OS gives them to LC, which may or may not be sorted. Adding a sort there makes sure that what the user sees will be easy to navigate.
The filter command is very flexible, worth spending a moment with its Dictionary entry to learn the scope of what you can do with it:
https://livecode.com/resources/api/#liv ... ipt/filter
https://livecode.com/resources/api/#liv ... invisibles
The .DS_Store file is created dynamically by the Finder to store folder-specific view preferences, such as whether list or icon mode, column widths for list mode, rect, etc. If you create a new folder and do not alter its appearance, a .DS_Store file may not be created.
To filter unwanted elements from a list, use the filter command. On macOS and Linux, files beginning with "." are not shown in lists by default, so to exclude those from the list returned from "the files" you could add a line to your handler:
Code: Select all
on mouseUp
answer folder "Where are the sound files?"
if it is not empty then
set the defaultFolder to it
end if
put the files into tList
filter tList without ".*"
sort lines of tList
put tList into field "playlist"
end mouseUp
The filter command is very flexible, worth spending a moment with its Dictionary entry to learn the scope of what you can do with it:
https://livecode.com/resources/api/#liv ... ipt/filter
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Annoying ++
As always Richard, most grateful.
If we're treading on thin ice, well you might as well dance.