• 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
UI scripting...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

UI scripting...


  • Subject: UI scripting...
  • From: Jean-Christophe Helary <email@hidden>
  • Date: Sun, 10 Jan 2016 17:57:50 +0900

I'm using UIElementInspector to navigate a Java application.

I'm stuck when I want to set the value of a text field from Script Editor, when I can do it from UIElementInspector...

The UI structure is the following:

<AXApplication: “OmegaT”>
 <AXWindow: “プロジェクトの検索”>
  <AXComboBox>
   <AXTextField>

Attributes:
   AXSelectedTextRange (W):  “pos=0 len=18”
   AXNumberOfCharacters:  “18”
   AXEnabled:  “1”
   AXParent:  “<AXComboBox>”
   AXSize:  “w=729 h=28”
   AXFocused (W):  “1”
   AXRole:  “AXTextField”
   AXTopLevelUIElement:  “<AXWindow: “プロジェクトの検索”>”
   AXInsertionPointLineNumber:  “0”
   AXHelp:  “(null)”
   AXPosition:  “x=84 y=48”
   AXTitle:  “(null)”
   AXWindow:  “<AXWindow: “プロジェクトの検索”>”
   AXRoleDescription:  “テキストフィールド”
   AXValue (W):  “SSID : KAGAWA-WiFi”
   AXVisibleCharacterRange:  “pos=0 len=18”
   AXSelectedText (W):  “SSID : KAGAWA-WiFi”
   AXFrame:  “x=84 y=48 w=729 h=28”

What I do is try to set the value of the Search field once the Search is called. First, I've identified the text field and a "get value" gives me the value identified in AXValue and AXSelectedText above.

Now, in UIElementInspector I can go to the AXSelectedText (W) attribute (btw, would this W thing mean "writable" ?) and I can change the value there and it is reflected in the application (on a side note, I cannot change the AXValue attribute...)

But when I want to do the same thing from AS, I miserably fail and the following code returns the original value...

tell application "System Events"
	tell process "OmegaT"
		set frontmost to "true"
		click menu item 18 of menu 4 of menu bar 1
		delay 0.5
		set value of text field 1 of combo box 1 of window 1 to {{"essai"}}
		get value of text field 1 of combo box 1 of window 1
	end tell
end tell

I've also been looking for a thorough reference on how to use UI scripting, any pointer ?

Thank you all in advance.

Jean-Christophe
 _______________________________________________
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: UI scripting...
      • From: Bill Cheeseman <email@hidden>
    • Re: UI scripting...
      • From: Yvan KOENIG <email@hidden>
  • Prev by Date: Re: How to Run a "sudo" Terminal Command
  • Next by Date: Re: UI scripting...
  • Previous by thread: Re: How to Run a "sudo" Terminal Command
  • Next by thread: Re: UI scripting...
  • Index(es):
    • Date
    • Thread