RE: UI Scripting: Save as PDF
RE: UI Scripting: Save as PDF
- Subject: RE: UI Scripting: Save as PDF
- From: "Dixon, Hugh - BUP" <email@hidden>
- Date: Wed, 22 Jan 2003 10:19:53 -0000
>
-----Original Message-----
>
From: Jared [mailto:email@hidden]
>
Sent: 22 January 2003 08:22
>
To: email@hidden
>
Subject: UI Scripting: Save as PDF
>
>
>
I'm trying to access the "Save as PDF" button of a TextEdit Print
>
sheet.
I can't test it on TextEdit at the moment (10.1.5 here at work) but this
works for me in AppleWorks. Hope it helps you:
tell application "System Events"
tell process "AppleWorks 6"
set frontmost to true
keystroke "p" with command down
delay 1
tell UI element 6 of window "Print"
click button "Save as PDF..."
end tell
tell window "Save to File"
click button "Save"
end tell
end tell
end tell
I had to get a count of all the UI elements of the Print window and then
work through each by index asking for their own "child" elements before I
found the "Save as PDF..." button. UIElementInspector wasn't much help here
because of the "unknowns".
Love those delays...
Regards,
Hugh
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
www.mimesweeper.com
**********************************************************************
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.