Re: UI Scripting: Save as PDF
Re: UI Scripting: Save as PDF
- Subject: Re: UI Scripting: Save as PDF
- From: Bill Cheeseman <email@hidden>
- Date: Wed, 22 Jan 2003 17:40:29 -0500
>
> On Wednesday, January 22, 2003, at 10:57 AM, Bill Cheeseman wrote:
>
>
>
>> on 03-01-22 3:21 AM, Jared at email@hidden wrote:
>
>>
>
>>> I'm trying to access the "Save as PDF" button of a TextEdit Print
>
>>> sheet. I have tried everything I can think. According to UI Element
>
>>> Inspector, there are 2 levels of "Unknowns" that I have to go through
>
>>> in order to click the button. Can anyone help me by explaining what
>
>>> these Unknowns are and how I can click the button?
>
>>
>
>> UI Browser generates this script:
>
>>
>
>> click button "Save As PDF
>
>> " of unknown 2 of unknown 1 of window "Print"
>
>> of application process "TextEdit"
>
>>
>
>> But I don't suppose that helps much. There's nothing we can do about
>
>> unknowns.
It turns out that the script I generated is wrong. I found a bug in the
accessibility API that causes the Print sheet to think the application is
its parent, while the main window thinks the Print sheet is one of its
children. A presumably related bug is that accessibility thinks the Print
sheet is a "window" when it's supposed to be a "sheet."
So the correct script is 'click button "Save As PDF" of unknown 2 of unknown
1 of sheet "Print" of window "<name>" of application process "TextEdit"
But it still won't do you any good. At least now you know there are even
more problems standing in the way than you thought. :-)
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont -
http://members.valley.net/croquetvermont
_______________________________________________
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.