Download the files from the folder on the external drive

I have this script that opens the most recent file in a folder.

However I have now moved to an external drive.

I thought I would use this line

last element of the value latestFile (sort (get the files in the folder "HotFolderA" of the "Dropbox folder" from the folder "CloudStorage" in the folder "Volumes" of the file ((path to the startup disk))) by creation date) as alias

but that

Result:

error "' Finder has been an error: cannot get the file \"Volumes\ ' startup disk. " ' number-1728 of the folder "Volumes" of startup disk

How can I do it keep this method?

Matt

tell application "Finder"
  set latestFile to last item of (sort (get files of folder "AA" of folder (path to desktop folder)) by creation date) as alias
set fileName to latestFile's name

 open latestFile
end tell

You used the backslash \ (like Windows) instead of the slash /.

Tags: Mac OS & System Software

Similar Questions

Maybe you are looking for