Frage

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
War es hilfreich?

Lösung

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"
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top