Re: Set Contents not working
Re: Set Contents not working
- Subject: Re: Set Contents not working
- From: kai <email@hidden>
- Date: Mon, 14 Nov 2005 18:16:28 +0000
On 14 Nov 2005, at 17:14, Ted wrote:
tell application "TextEdit"
make new document
set the contents of front document to "Database report on " &
dName & return & return
I'm getting the following error in Script Editor:
"TextEdit got an error: Can't make contents of document 1 into type
reference."
Can someone tell me what I'm doing wrong? I've looked through the
TextEdit dictionary, but it seems like it should work.
You should need only a minor modification, Ted. From the TextEdit
suite of TextEdit's dictionary:
----------
document n [inh. document; see also Standard Suite] : A TextEdit
document.
elements
contained by application, application.
properties
text (text) : The text of the document.
----------
So try something like:
----------
tell application "TextEdit"
make new document
set the text of front document to "Database report on " & dName &
return & return
end tell
----------
More concisely, you should also be able to do this:
----------
tell application "TextEdit" to make new document with properties
{text:"Database report on " & dName & return & return}
----------
---
kai
_______________________________________________
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