Question

What is the AppleScript code for a "Save As" dialog with a custom file type extension?

I know the code for Open dialog:

set theFiles to (choose file of type {"set"} with prompt "Save As File" without multiple selections allowed) as string
Was it helpful?

Solution

Save commands are found in applications themselves, not within standard additions. If you are trying to establish a path to pass to a save command, you can use something like this:

set resultFile to (choose file name with prompt "Save As File" default name "My File" default location path to desktop) as text
if resultFile does not end with ".txt" then set resultFile to resultFile & ".txt"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top