Re: No effect when I click with UI scripting on the sidebar of "Open..." navigation window
Re: No effect when I click with UI scripting on the sidebar of "Open..." navigation window
- Subject: Re: No effect when I click with UI scripting on the sidebar of "Open..." navigation window
- From: quark67 <email@hidden>
- Date: Sun, 5 Nov 2017 16:00:45 +0100
Thanks for the tip and the explanation. I don't have UI Browser nor Script
Debugger, but I sometimes use Accessibility Inspector.app from the Xcode bundle
(in Xcode.app/Contents/Applications/).
> Le 5 nov. 2017 à 04:32, Christopher Stone <email@hidden> a
> écrit :
>
> On 11/04/2017, at 21:43, quark67 <email@hidden <mailto:email@hidden>>
> wrote:
>> I have found this solution (but strange: why doesn't click behave as
>> expected?):
>>
>> tell application "Preview"
>> tell application "System Events"
>> tell process "Preview"
>> --click UI element 1 of row 2 of outline 1 of scroll
>> area 1 of splitter group 1 of window 1
>
> Here you're futzing around with element 1 — NOT the row.
>
>> set selected of row 2 of outline 1 of scroll area 1 of
>> splitter group 1 of window 1 to true
>> --get name of UI element 1 of row 2 of outline 1 of
>> scroll area 1 of splitter group 1 of window 1
>> end tell
>> end tell
>> end tell
>>
>> If anybody has an explanation, I would like to hear it.
>
>
> Hey There,
>
> An object may or may not support actions.
>
> When I'm diagnosing something like this I usually just use UI Browser
> <http://pfiddlesoft.com/uibrowser/> but you can pull a lot of information
> about an object into the Apple Script Editor or Script Debugger
> <http://www.latenightsw.com/>.
>
> (Script Debugger has a pretty print function that makes lists like this
> easier to read, and it's object explorer makes discovering things about an
> app's object model much easier than fooling around with the Script Editor.)
>
> ------------------------------------------------------------------------------
>
> tell application "System Events"
> tell application process "Preview"
> tell window "Open"
> tell group 1
> tell splitter group 1
> tell scroll area 1
> tell outline 1
> tell row 3
>
> set diagnosticsList to {¬
> "----- PROPERTIES -----", ¬
> properties, ¬
> "----- UI ELEMENTS -----", ¬
> UI elements, ¬
> "----- ATTRIBUTES -----", ¬
> attributes, ¬
> "----- ACTIONS -----", ¬
> actions, ¬
> "----- END -----"}
>
> end tell
> end tell
> end tell
> end tell
> end tell
> end tell
> end tell
> end tell
>
> ------------------------------------------------------------------------------
>
> So — you have no actions available for the row.
>
> Click is not just magically available everywhere.
>
> But as you've discovered †here is a selected property, so it is possible to
> interact with the object.
>
> --
> Best Regards,
> Chris
>
> _______________________________________________
> 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
_______________________________________________
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