> Any number of variations thereof brings no joy. Any help welcome.
set textEditFile to (make new document at beginning)
I'll let you take it from there... it's late.
djb
--
"The thing about saying the wrong words is that A, I don't notice it, and B,
sometimes orange water gibbon bucket and plastic." -- Mr. Burrows
> In article <010220052228037860%dave@N_O_T_T_H_I_S.balderstone.ca>,
> Dave Balderstone <dave@N_O_T_T_H_I_S.balderstone.ca> wrote:
>
> > > Any number of variations thereof brings no joy. Any help welcome.
> >
> > set textEditFile to (make new document at beginning)
>
> I tried it, but it didn't help.
This works on my machine:
set theText to "the rain in Spain"
set fileName to "Text Edit File.rtf"
set thePath to POSIX path of (path to desktop) & fileName
tell application "TextEdit"
activate
set textEditFile to (make new document at beginning with properties
{text:theText})
save textEditFile in thePath
end tell
'thePath' must be a POSIX path, though an alias will do if the
destination file already exists. I haven't checked if this is standard
behaviour for 'save' or whether it's unique to TextEdit. 'thePath' must
also be the path to the *file*, not to the folder where you want it to
appear. (This morning, I managed to replace my desktop with the file I
was trying to save! Fortunately, I was able to restore it from a very
recent backup. :-) )
In Jaguar, with TextEdit 1.2, I can't find any scripting way to
influence the text type (plain text, rich text) of the saved document.
NG
--
To e-mail me, change '.invalid' to '.demon.co.uk'.
> I tried it, but it didn't help.
Well, maybe it helped the OP.
--
"Modern technology has enabled us to communicate and organize with speed and
efficiency never before possible. People have gotten less competent to
compensate for this." - CW