I am very new to AppleScript so I need to ask some really basic questions.
I wish to use the Choose File command to select a pdf from a specified folder and then open the pdf:
set SelectedFile to (choose file of type "pdf" with prompt "Choose the file from the 2018 prospective clients folder" default location alias "Macintosh HD:Users:victor:vwdata:notary:2018:2018-prospective work" without invisibles)
tell application "Finder"
open SelectedFile
end tell
However what is not clear is whether it is possible to include commands to sort the window allowing me choosing the pdf. For example, if I wanted to the files sorted in reverse order on the modified date column.
For a finder window I know this possible, eg:
tell application "Finder"
activate
make new Finder window
set target of Finder window 1 to folder "2018-prospective work" of folder "2018" of folder "notary" of folder "vwdata" of folder "victor" of folder "Users" of startup disk
set width of column id name column of list view options of Finder window 1 to 100
set bounds of Finder window 1 to {0, 23, 1000, 1000}
set the sidebar width of Finder window 1 to 0
set statusbar visible of Finder window 1 to false
set toolbar visible of Finder window 1 to false
set sort column of list view options of Finder window 1 to modification date column
set sort direction of column id modification date column of list view options of Finder window 1 to reversed
end tell
but adding the relevant commands does not seem to work when coupled with the Choose File commands (or least I do not know how to do it).
Any help would be gratefully received.
Model: iMac
AppleScript: 2.7
Browser: Safari 12.0.1
Operating System: macOS 10.14