• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Set Contents not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Set Contents not working


  • Subject: Re: Set Contents not working
  • From: Bill Cheeseman <email@hidden>
  • Date: Mon, 14 Nov 2005 16:56:59 -0500
  • Thread-topic: Set Contents not working

on 2005-11-14 12:14 PM, Ted at email@hidden 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."

In TextEdit and many other modern apps, you have to say 'set text of front
document to "XXX"'.

Every application is a little different. To get a script right, you
generally have to read the app's terminology dictionary (which isn't always
terribly informative) and use trial-and-error until it works.

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com

PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes


 _______________________________________________
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

References: 
 >Set Contents not working (From: Ted <email@hidden>)

  • Prev by Date: Re: when words aren't words
  • Next by Date: Re: click Zoom button
  • Previous by thread: Re: Set Contents not working
  • Next by thread: Re: Set Contents not working
  • Index(es):
    • Date
    • Thread