Hi,
Not sure what
1. It doesn't set the prompt "Please name the file:" anywhere in the window ( I expected it in the title bar like the answer file command)
means. Here is a picture of what a correctly setup dialog should look like (on 'nix)
- ...
If you mean where it says 'Name', then you have to provide that in the script.
First thing that caught my attention was the way you constructed the line to save the file (the parts in bold) ~
ask file "Please name the file:" with ("documents/vmpb/" & field "lastfile") with type "TABLET File|vmpbx" or type "DESKTOP File|vmpb"
I am assuming that is the default path you want the save to go to, however it is an incorrectly formatted path far as I know.
ask file prompt [with defaultFilePath] [with type types [or type types ...]] [as sheet]
You repeated that format for the path in the second code listing, adding a slash in front... ~
ask file "Save data as" with "/documents/" with type "CSV Files|csv"
For a folder path, the starting slash is the root of the disc. I seriously doubt your documents folder is in the root folder.
I actually tested this on 'nix, and for whatever reason it went through to my root folder instead of returning an error, but I am not sure OSX would be so forgiving (will probably need to file a bug report later on this for 'nix
).
Anyway, the correct format for your statement should look something like ~
Code: Select all
ask file "Save data as" with "/home/user/Documents/vmpb/My_Filename.Extension" with type "CSV Files|csv"
That is a complete path from the root directory to a folder on 'nix, it could also (probably) be expressed as
Code: Select all
ask file "Save data as" with specialFolderPath("Documents") & "/vmpb/My_Filename.Extension") with type "CSV Files|csv"
to make it more universal, although that did not work
here (probably bug report 2
).
Also of note, here I had to capitalize the word "Documents" or it wound up in my home folder, so you probably have copies of anything you went all the way through in your home folder with "documents".
As well, if the last folder in your path doesn't exist, it will stop at the last existing folder. For instance, I don't have a folder "vmbp" on my system, so the last real folder was "Documents", and that is where the dialog went to.