• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: No effect when I click with UI scripting on the sidebar of "Open..." navigation window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Christopher Stone <email@hidden>
  • Date: Sat, 4 Nov 2017 22:32:06 -0500

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

  • Follow-Ups:
    • Re: No effect when I click with UI scripting on the sidebar of "Open..." navigation window
      • From: quark67 <email@hidden>
References: 
 >No effect when I click with UI scripting on the sidebar of "Open..." navigation window (From: quark67 <email@hidden>)
 >Re: No effect when I click with UI scripting on the sidebar of "Open..." navigation window (From: quark67 <email@hidden>)

  • Prev by Date: Show Emoji & Symbols GUI access
  • Next by Date: Re: Show Emoji & Symbols GUI access
  • Previous by thread: Re: No effect when I click with UI scripting on the sidebar of "Open..." navigation window
  • Next by thread: Re: No effect when I click with UI scripting on the sidebar of "Open..." navigation window
  • Index(es):
    • Date
    • Thread