Re: Using the document element in TextEdit
Re: Using the document element in TextEdit
- Subject: Re: Using the document element in TextEdit
- From: David Durkee <email@hidden>
- Date: Sun, 17 Jul 2005 19:49:02 -0500
Try this:
tell application "TextEdit"
-- push the TextEdit application to the front
activate
-- let the user select a rtf file from disk
set zeFile to choose file of type {"public.rtf"}
open zeFile
set doc to document 1
-- get the document properties
return properties of doc
end tell
You generally can't open a file by setting a document's path
property. I'm surprised it even lets you set the path property, but
my guess is that doing so only affects subsequent Save commands. To
open a file in just about any scriptable app, use the open command.
David
On Jul 17, 2005, at 6:46 AM, Emile Schwarz wrote:
tell application "TextEdit"
-- push the TextEdit application to the front
activate
-- get a new document
set doc to make new document
-- let the user select a rtf file from disk
set zeFile to choose file of type {"public.rtf"}
-- set to the path property the file reference
set path of doc to zeFile
-- get the document properties
return properties of doc
end tell
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden