How to list the files inside a folder without the choose the location.
eg:
put"D:\test\an" into content
I want to list the content of "D:\test\an" into a variable is it possible . I am using windows system

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Code: Select all
function getFilesInFol tFol
put empty into rFilesInFol
if there is a folder tFol then
set the defaultFolder to tFol
put the files into rFilesInFol
filter rFilesInFol without ".*"
end if
return rFilesInFol
end getFilesInFol
Code: Select all
function getFilesInFol tFol
put empty into rFilesInFol
if there is a folder tFol then
put the folder into tOldDir
set the folder to tFol
put the files into rFilesInFol
filter rFilesInFol without ".*"
set the folder to tOldDir
end if
return rFilesInFol
end getFilesInFol
Code: Select all
set the folder to tFolder
if the folder is tFolder then -- do stuff we expect....
Code: Select all
function getFilesInFol tFol
put empty into rFilesInFol
if there is a folder tFol then
put the folder into tOldDir
set the folder to tFol
if the folder is tFol then -- do stuff we expect....
put the files into rFilesInFol
filter rFilesInFol without ".*"
set the folder to tOldDir
end if
end if
return rFilesInFol
end getFilesInFol