Using the document element in TextEdit
Using the document element in TextEdit
- Subject: Using the document element in TextEdit
- From: Emile Schwarz <email@hidden>
- Date: Sun, 17 Jul 2005 13:46:38 +0200
Hi all,
this is something that I don't understand running the following code:
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
Here's the properties I get:
tell application "TextEdit"
activate
make new document
document 1
choose file of type {"public.rtf"}
alias "Macintosh HD:AWKS. Front Window Properties.rtf"
set path of document 1 to alias "Macintosh HD:AWKS. Front Window Properties.rtf"
get properties of document 1
{modified:true, path:"/AWKS. Front Window Properties.rtf", text:"",
class:document, name:"AWKS. Front Window Properties.rtf"}
end tell
You may ask "where's the trouble ?" and you would be a good question !
Nothing appears in the newly created window (the styled text - rtf file - is not
loaded).
Why ?
Emile
_______________________________________________
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