Open Selected Files from list??

I’m decent at Applescripting but certain techniques still evade my understanding. I have this simple script below where I would like to:

  1. Retrieve all items/files of a certain location
  2. Make a list of these items
  3. Display these items in a list dialog
  4. Take the multi-selection of the user
  5. Send that to listOfNames
  6. Lastly open all items selected

set listOfNames to {}
tell application "Finder"
          set filelist to every file of the desktop
          repeat with currentFile in filelist
                    set currentFileName to (the name of currentFile)
                    copy currentFileName to the end of listOfNames
          end repeat
end tell
 
set selectedFiles to choose from list listOfNames
 
tell application "Finder" to open selectedFiles
 

I know the problem is that I’m telling “Finder” to open something that is only a name but how do I make the reference from the name back to the actual file it’s referring to? I’ve tried POSIX methods but I don’t really get how they work too much yet or how to use them in this instance. Thank you so much for your help!

Model: Macbook Pro 15" Late 2011 w/Mavericks
Browser: Safari 537.74.9
Operating System: Mac OS X (10.8)

Hi,

as you have the reference to the parent folder,
you can do this


set sourceFolder to choose folder
tell application "Finder" to set filelist to name of every file of sourceFolder
set selectedFiles to choose from list filelist with multiple selections allowed
if selectedFiles is false then return
repeat with aFile in selectedFiles
	tell application "Finder" to open file aFile of sourceFolder
end repeat

Wow beautiful! I’ll study this and see how this breaks down and what I was missing! Thanks so much!!!