Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7960703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:49:50+00:00 2026-06-04T04:49:50+00:00

AppleScript’s list data type has only a very limited support for boolean test specifiers

  • 0

AppleScript’s list data type has only a very limited support for boolean test specifiers. Besides picking items by range (with the item keyword), specifying a class will work:

get every «class furl» of {1, "Test", (POSIX file "/posix/path")} --> {file ":hfs:path"} 

When the list items are references, dereferencing with the contents keyword will work:

get every «class furl» of {1, "Test", a reference to (POSIX file "/posix/path")} --> {}
get every «class furl» of contents of {1, "Test", a reference to (POSIX file "/posix/path")} --> {file ":hfs:path"}

So why does the following code set allTextAreas to an empty list:

tell application "System Events"
    set allUIElements to entire contents of window 1 of someApplication 
    set allTextAreas to every text area of contents of allUIElements --> {}
end tell

given that allUIElements is a list of references to UI element objects, and that at least one of them is of class text area?

Note I am not looking for suggestions how to retrieve all UI elements of a certain type from the list (a repeat loop will do that) – I would like to understand why the selector pattern fails in this specific case.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:49:52+00:00Added an answer on June 4, 2026 at 4:49 am

    Getting the UI elements from the application results in a list of object specifiers: application objects (a form of nested containers) where each item in the hierarchy has several properties, including a class – Technical Note TN2106 might shed more light on this –, while your first example used a file URL (a type of file reference) which has a base class.

    So you will need to use either an application filter reference form when getting the objects from the application or query the desired properties of the returned objects, for example:

    set allButtons to {}
    tell application "System Events" to tell application process "Safari"
        set allUIElements to entire contents of window 1
        repeat with anElement in allUIElements
            try
                if class of anElement is button then set end of allButtons to contents of anElement
            end try
        end repeat
    end tell
    allButtons
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could someone please give a list of all the applescript data types (the things
Applescript's choose from list user interaction has a cancel button — I want this
I want to add list of mp3 files to iTunes via a applescript. The
I am creating an application using AppleScript and I want to display a list
I have an applescript that reads data from a CSV (successfully!). After my script
I have a txt plain file that has a list of numbers. One number
Mac has applescript 'built in' and I've found its pretty nice to work with
I'm trying to make an Applescript that takes a list of names and makes
Is there anyway to programmatically get a list of iOS apps from iTunes? AppleScript
I trying to output a list of todo items from the Mac app Things

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.