Re: GUI TextEdit
Re: GUI TextEdit
- Subject: Re: GUI TextEdit
- From: Philip Aker <email@hidden>
- Date: Sat, 2 Jun 2007 00:50:29 -0700
On 2007-06-01, at 23:23:32, Michelle Steiner wrote: On Jun 1, 2007, at 11:21 PM, Rick Gordon wrote: Why not just forget the System Events, and tell document 1 to save as "HTML"
From TexttEdit's dictionary:
save v : Save an object. save reference : the object for the command [as Unicode text] : The file type in which to save the data. [in alias] : The file in which to save the object.
Did you try it? I couldn't get it to work.
The problems I had with this script is that it seemed to run too fast for TE to handle. So I had to pepper it with calls to 'delay'. Also, if I pressed Cmd-R in Script Editor, then sometimes it was like the keystroke carried over to TE and again messed things up.
on TESaveAs(theKind, theTitle) tell application "TextEdit" to activate tell application "System Events" to tell application process "TextEdit" to tell window 1 keystroke "s" using {command down, shift down} tell sheet 1 keystroke theTitle delay 1 tell group 1 to tell pop up button 1 click click menu item theKind of menu 1 delay 1 end tell click button "Save" end tell end tell end TESaveAs
TESaveAs("HTML", "Acme-Sales-2007-05")
Philip Aker email@hidden
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden