Apple script for extracting a text from the mac application

Discussion in 'AppleScript' started by Affu, Sep 2, 2015.

  1. Affu

    Affu New Member

    Joined:
    Sep 2, 2015
    Messages:
    4
    Likes Received:
    0
    Is it possible to check the change in texts in Mac application's UI using apple Script? I need to create an apple script for the following scenario - click on the connect button only when the status changes to "connected", the status will be displayed on the UI. Can we write script for checking with the text being displayed on the UI? expecting an reply as early as possible.
     
    Affu, Sep 2, 2015
    #1
    1. Advertisements

  2. Affu

    Cory Cooper Moderator

    Joined:
    May 19, 2004
    Messages:
    5,156
    Likes Received:
    152
    Hello and welcome...sorry we haven't responded sooner.

    I am a little confused about what you are trying to accomplish. Can you elaborate on the scenario a little bit?

    -Are you writing a new application?
    -Are you trying to script the Finder or a specific application?
    -Where is the connect button/connected status you are describing?
    -From where are you trying to extract the text?

    C
     
    Cory Cooper, Sep 5, 2015
    #2
    Affu likes this.
    1. Advertisements

  3. Affu

    Affu New Member

    Joined:
    Sep 2, 2015
    Messages:
    4
    Likes Received:
    0
    Hi Corey, thanks for your response.

    I have a Mac application for which i need to write apple script for UI automated testing.

    There is a tab group in the window of the application which contains many static texts and text fields. I don't know how to access these static texts to get the value of the String it contains.

    1. Consider this scenario, i am clicking a button "Connect" in the application, there will be change in the string being displayed on the tab as "Connecting" and then finally turns into "Connected". This string value is stored as a AXStaticText. I need to know whether it is possible to get the value of this static text which is currently a AXChildren to the AXTabGroup using apple script alone? Currently i am trying to use shell script along with apple script to get the connection status with the help of the log file.

    2. And also i want to know how to make a click action on a child element under a tab group. I am having a AXTabGroup under which it contains many static texts and buttons. How can i make click actions for these children?
    I am not able to script for generating actions for such children elements using apple script.


    AXChildren, AXTabGroup, AXStaticText are termed based on the analysis using Accessibility inspector.

    I need a solution for question number - 2 at the earliest.
    Thanks.
     
    Affu, Sep 7, 2015
    #3
  4. Affu

    Cory Cooper Moderator

    Joined:
    May 19, 2004
    Messages:
    5,156
    Likes Received:
    152
    OK...thanks for the additional information.

    Unfortunately, that scenario is outside my knowledge and experience. The best suggestion I can make is to post your question(s) at these discussion forums:

    Apple Developer Forums
    MacScripter

    I wish I could lend a hand, but I have never done any application/software development, or anything but very basic scripting. Hopefully they can help you out.

    C
     
    Cory Cooper, Sep 7, 2015
    #4
  5. Affu

    Affu New Member

    Joined:
    Sep 2, 2015
    Messages:
    4
    Likes Received:
    0
    yea okay. Thanks Corey.
     
    Affu, Sep 7, 2015
    #5
  6. Affu

    Cory Cooper Moderator

    Joined:
    May 19, 2004
    Messages:
    5,156
    Likes Received:
    152
    No worries.

    Good luck, and let us know if they help you out.

    C
     
    Cory Cooper, Sep 7, 2015
    #6
  7. Affu

    Affu New Member

    Joined:
    Sep 2, 2015
    Messages:
    4
    Likes Received:
    0
    Yea sure Corey. Thanks.
     
    Affu, Sep 8, 2015
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.