I need to get the file name programatically on Mac, am using Selenium to download the file and from downloads folder i need to pick the same file to install programatically,
Yes Mavericks does open the oldest, but this seams to work by specifying the last item.
tell application "Finder"
set latestFile to last item of (sort (get files of (path to downloads folder)) by creation date) as alias
set fileName to latestFile's name
end tell