• 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: Unable to target a specific UI element in Preview.app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unable to target a specific UI element in Preview.app


  • Subject: Re: Unable to target a specific UI element in Preview.app
  • From: Axel Luttgens <email@hidden>
  • Date: Sun, 17 Apr 2016 09:49:46 +0200

> 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




 _______________________________________________
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: Unable to target a specific UI element in Preview.app
      • From: Yvan KOENIG <email@hidden>
  • Prev by Date: Re: Scriptable Task-Managers
  • Next by Date: Re: Unable to target a specific UI element in Preview.app
  • Previous by thread: Re: Unable to target a specific UI element in Preview.app
  • Next by thread: Re: Unable to target a specific UI element in Preview.app
  • Index(es):
    • Date
    • Thread