On Feb 3, 2010, at 1:24pm, Luther Fuller wrote: This works.
(path to documents folder) tell application "Finder" to set ListOfFiles to name of files of the result set ChosenFile to (choose from list ListOfFiles with prompt "Select a File and press Choose" OK button name "Choose")
The problem seems to be putting 'path to ...' inside the tell Finder block. The new question is: Why does this make a difference?
Hmmm, But try this: ---------------- tell application "Finder" set ListOfFiles to name of files of folder (path to documents folder) set defaultItems to {item 2 of ListOfFiles} -- doesn't make it work end tell
set ChosenFile to (choose from list ListOfFiles with prompt "Select a File and press Choose" OK button name "Choose" default items defaultItems)
(path to documents folder) tell application "Finder" set ListOfFiles to name of files of the result end tell
set ChosenFile to (choose from list ListOfFiles with prompt "Select a File and press Choose" OK button name "Choose") ------------------
Cancel the first dialog and the second also doesn't work.
Reverse the order (Luther's version executing first) and they both work.
What a curious little bug!
ES
|