Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Making a TextEdit file

3 views
Skip to first unread message
Message has been deleted

Dave Balderstone

unread,
Feb 1, 2005, 11:28:03 PM2/1/05
to
In article <noone-7C69E6....@comcast.dca.giganews.com>, John
Rethorst <no...@nowhere.net> wrote:

> 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

Message has been deleted

Nigel Garvey

unread,
Feb 2, 2005, 7:38:06 AM2/2/05
to
In article <michelle-393438...@news.west.cox.net>, Michelle
Steiner <mich...@michelle.org> wrote:

> 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'.

Dave Balderstone

unread,
Feb 2, 2005, 8:50:09 AM2/2/05
to
In article <michelle-393438...@news.west.cox.net>, Michelle
Steiner <mich...@michelle.org> wrote:

> 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

Message has been deleted
0 new messages