Re: Unable to target a specific UI element in Preview.app
Re: Unable to target a specific UI element in Preview.app
- Subject: Re: Unable to target a specific UI element in Preview.app
- From: Yvan KOENIG <email@hidden>
- Date: Sun, 17 Apr 2016 11:19:33 +0200
Le 17 avr. 2016 à 09:49, Axel Luttgens < email@hidden> a écrit :
Le 15 avr. 2016 à 02:49, quark67 a écrit :
I want to click in the text field of a password-protected PDF by GUI scripting. <PastedGraphic-1.png>
[…]
Despite this, is there a way to target the secure text field or not ? Thanks.
[…]
Hello, Assuming the protected document is opened in Preview’s front window, this one works here (Yosemite 10.10.5): tell application "Preview" to activate delay 1 tell application "System Events" tell application process "Preview" tell front window tell splitter group 1 tell text field 1 set focused to true set value to "test" end tell end tell end tell keystroke return end tell end tell The (quite generous) delay allows all UI elements to be in place, should Preview need to be brought to front when above snippet is run. HTH, Axel
Hello Axel
When running El Capitan, there is no text field in the splitter group so your script returns :
error "Erreur dans System Events : Il est impossible d’obtenir text field 1 of splitter group 1 of window 1 of application process \"Preview\". Index non valable." number -1719 from text field 1 of splitter group 1 of window 1 of application process "Preview"
Yvan KOENIG running El Capitan 10.11.4 in French (VALLAURIS, France) dimanche 17 avril 2016 11:19:21
|
_______________________________________________
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