Re: making a new file
Re: making a new file
- Subject: Re: making a new file
- From: Nigel Redmon <email@hidden>
- Date: Mon, 4 Jun 2007 17:20:22 -0700
Nevermind--I hadn't yet figured out where to find the dictionary for
the build-in commands, but I just did ("standard additions")--I think
I can figure it out form here ("choose file name...").
On Jun 4, 2007, at 4:57 PM, Nigel Redmon wrote:
I'm writing a scripting addition. One of the functions I have
implemented is a command that lets the user read a certain type of
file (a standard MIDI file). My command accepts a file reference
that the user can get from the "choose file" applescript command
("set blahblah to read MIDI file (choose file)")--it works great.
Now I'm trying to go the other way, with a command that accepts
data and a reference to a file that does not yet exist; the command
will create the new file, write the data in the appropriate format,
and close the file. I would expect this file name to come from the
user selecting a file in the standard Mac directory dialog.
The AppleScript Language Guide is obviously a a bit dated, saying,
"You can obtain a file specification from the New File scripting
addition command distributed with AppleScript, or from an
application command that returns a file specification," and giving
the following example:
set fileSpec to new file default name "New Report"
class of fileSpec --result: file specification
Well, there is no "New File scripting addition". How can I do this?
I'd like to avoid scripting to a third application to get the job
done (that is, if it's not built in, I'll probably have to write my
own command).
Thanks
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden