I’m decent at Applescripting but certain techniques still evade my understanding. I have this simple script below where I would like to:
- Retrieve all items/files of a certain location
- Make a list of these items
- Display these items in a list dialog
- Take the multi-selection of the user
- Send that to listOfNames
- 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)