Why I can't compile "new file" command?

I want a file dialog for creating a new file and wanted use the command New File described in AppleScript Additions. But I can’t succeed make compile a line using this command. Have you an example or what’s the problem?

You can use it just like it says in the Standard Additions dictionary:

Of course, this just returns a file specification, it doesn’t actually create the file, that’s up to you and your script (usually with the file read/write commands).

Jon

Thanks a lot it works fine.

About docs, I checked again the apple’s pdf I downloaded about scripting additions and it mentions “New File” command to create a file and “Choose File” to choose a file. Do I have a wong doc? And where find the good one?

Also where is this Standard Additions dictionary?

From the Script Editor’s File menu, select “Open Dictionary…” and (after a while) it will present you with a list of Scripting Additions and every application that is scriptable. Scroll down and select “Standard Additions” to see the commands available and a brief description of how to use the commands and their properties.

Jon

Thanks a lot and much more, very helpfull.

Yes the explanations are short but it’s better to have short right doc than long false doc :-). Those quick dic should not be a reason for apple to not update their real doc!

Just to reassure you that you weren’t going mad, ‘choose file name’ is the curent terminology for what used to be called ‘new file’ when the Scripting Additions guide was written. It’s still the same underlying token, so any script written with ‘new file’ on an old system will show ‘choose file name’ if it’s opened in Script Editor in OS X - and vica versa.

Much of Apple’s AppleScript documentation has been due for a rewrite for several years. When the Scripting Additions guide was written, the Standard Additions commands were still spread over several individual files! :slight_smile: