• 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
Using the document element in TextEdit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Using the document element in TextEdit
      • From: David Durkee <email@hidden>
  • Prev by Date: Work-around to TextEdit "close front window saving no"
  • Next by Date: Re: what happened to Mail's scripts menu?
  • Previous by thread: Work-around to TextEdit "close front window saving no"
  • Next by thread: Re: Using the document element in TextEdit
  • Index(es):
    • Date
    • Thread