How to get a list of files in a folder copied with Copy File
Posted: Mon Oct 20, 2014 9:34 am
Hi all,
I'm trying to refer to a file which is inside a folder copied in a standalone with the appropriate Copy File dialog. There have to be something I'm doing wrong because I can't find a way to do it. Can't get the list of files.
In IDE all works fine, in Standalone I can't get it.
My first version:
My second version:
My third version:
I'm trying to refer to a file which is inside a folder copied in a standalone with the appropriate Copy File dialog. There have to be something I'm doing wrong because I can't find a way to do it. Can't get the list of files.
In IDE all works fine, in Standalone I can't get it.
My first version:
Code: Select all
if the environment is "development" then
put the effective filename of this stack into myPath
set the itemDelimiter to slash
put "Sounds/" into last item of myPath
set the itemDelimiter to comma
set the defaultFolder to myPath
else -- standalone
set the defaultFolder to "Sounds" -- this gives the standard OS X sounds folder path
end if
put the files into soundListFiles
answer soundListFiles
My second version:
Code: Select all
if the environment is "development" then
put the effective filename of this stack into myPath
set the itemDelimiter to slash
put "Sounds/" into last item of myPath
set the itemDelimiter to comma
set the defaultFolder to myPath
else -- standalone
set the itemDelimiter to slash
get the effective filename of this stack
put item 1 to -2 of it & "/Sounds" into a
set the defaultFolder to a -- this gives "/Sounds"
end if
put the files into soundListFiles
answer soundListFiles
Code: Select all
if the environment is "development" then
put the effective filename of this stack into myPath
set the itemDelimiter to slash
put "Sounds/" into last item of myPath
set the itemDelimiter to comma
set the defaultFolder to myPath
else -- standalone
put specialFolderPath("engine") & slash & "Sounds" into soundsFolder -- gives an "invented" folder: Users/user/Library/Application Support/Sounds
set the defaultFolder to soundsFolder
end if
put the files into soundListFiles
answer soundListFiles