Re: GUI TextEdit
Re: GUI TextEdit
- Subject: Re: GUI TextEdit
- From: "Nigel Garvey" <email@hidden>
- Date: Sat, 2 Jun 2007 18:28:06 +0100
Philip Aker wrote on Sat, 2 Jun 2007 07:06:50 -0700:
>Both excellent points. I think you'll have to watch for setting the
>".rtf" extension though because the original may be something else.
>
>> 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}
>> repeat until (sheet 1 exists)
>> delay 0.2
>> end repeat
>> tell sheet 1
>> set value of text field 1 to (theTitle & ".rtf")
Hmmm. Yes. You're right. When I was experimenting this morning, the
".html" extension replaced the extension given didn't appear unless there
_was_ an extension to replace. Now it's appended to whatever's entered.
We-irrd.... :\
So the full handler should be:
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}
repeat until (sheet 1 exists)
delay 0.2
end repeat
tell sheet 1
set value of text field 1 to theTitle
tell group 1 to tell pop up button 1
click
repeat until (menu 1 exists)
delay 0.2
end repeat
click menu item theKind of menu 1
repeat while (menu 1 exists)
delay 0.2
end repeat
end tell
click button "Save"
end tell
end tell
end TESaveAs
TESaveAs("HTML", "Acme-Sales-2007-05")
NG
_______________________________________________
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