How to control where the answer file/folder dialog starts
This is a very simple lessons that explains how to make the 'answer file' and 'answer folder' dialogs start at a specific location of your computer.
The basic answer file command
Click on the button and see where the dialog has taken you. In my case, the last time I loaded the the file dialog it was in the 'CONFERENCE' folder within my 'Work' folder. If you now navigate anywhere on your drive, close the dialog, and press the button again you will notice that it loads in the same folder as when you closed the dialog last.
Make the file chooser always start in a specific location
We need to use the 'with' syntax which is detailed in the Documentation. By specifying '/users/ben/Desktop' I am telling the dialog to open at that folder. The user can still choose to go anywhere but each time the user clicks my button they will be presented with my 'Desktop' folder as their start point.
answer file "Select a file" with "/users/ben/Desktop"
You can or course set this in script allowing you to dynamically alter the place a user starts from.
put "/users/ben/Desktop" into tStartDirectory
answer file "Select a file" with tStartDirectory