Re: Scripting TextEdit
Re: Scripting TextEdit
- Subject: Re: Scripting TextEdit
- From: dev_sleidy <email@hidden>
- Date: Fri, 5 May 2006 22:52:09 -0400
What's wrong with this?
tell application "TextEdit"
--TextEdit has two elements of its own: documents and windows. No properties.
get front document returning theDoc
tell theDoc
--a TextEdit Suite document has a text property, part of the Text Suite
get text of theDoc returning theText -->"Recitative"
--Text Suite texts have a font property
font of theText -->"Can't get font of \"Recitative\"."
end tell
end tell
To clean the above code ...
tell application "TextEdit" to set tFont to (font of (get (get front
document)'s text's properties))
or
tell application "TextEdit" to (font of (get (get front document)'s
text's properties))
set tFont to result
To obtain the size of a single character, within a 'TextEdit's front
document window ...
set tChar to 88
tell application "TextEdit" to set tFont_Size to size of (character
tChar of text of document 1)
or
set tChar to 88
tell application "TextEdit" to size of (character tChar of text of document 1)
set tFont_Size to result
To answer - 'I had hoped to change the size of certain characters in
a document, but I didn't get far. Can someone help please?' ...
on Change_Size(local_Char, local_Size)
tell application "TextEdit" to set size of (character local_Char of
text of document 1) to local_Size
end Change_Size
my Change_Size(20, 99)
my Change_Size(13, 72)
my Change_Size(62, 48)
_______________________________________________
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