• 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: Yvan KOENIG <email@hidden>
  • Date: Fri, 15 Apr 2016 12:15:02 +0200

As there is a free scriptable app able to open PDF I don't use Preview when I face this kind of need.

set thePDF to (path to desktop folder as text) & "abc.pdf"
set thePassWord to "abc"
--tell application "Finder" to open file thePDF using application id "net.sourceforge.skim-app.skim"
tell application "Skim" to open file thePDF
tell application "System Events" to tell process "Skim"
set frontmost to true
tell window 1
class of UI elements
--> {splitter group, button, button, button, toolbar, image, menu button, static text}
tell first splitter group
class of UI elements
--> {radio group, text field, scroll area, splitter, splitter group, splitter, radio group, text field, scroll area}
tell first splitter group
class of UI elements
--> {scroll area, static text, static text, image, text field}
tell first text field
properties
--> {minimum value:missing value, orientation:missing value, position:{2168, 656}, class:text field, role description:"champ de texte sécurisé", accessibility description:missing value, focused:true, title:missing value, size:{241, 22}, value:"", help:missing value, enabled:true, maximum value:missing value, role:"AXTextField", entire contents:{}, subrole:"AXSecureTextField", selected:missing value, name:missing value, description:"champ de texte sécurisé"}
keystroke thePassWord & return
end tell
end tell
end tell
end tell
end tell

Of course, it's a very bad idea to store a password in a script but I'm just showing how to enter it.


Yvan KOENIG running El Capitan 10.11.4 in French (VALLAURIS, France) vendredi 15 avril 2016 12:14:43




 _______________________________________________
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: quark67 <email@hidden>
  • Prev by Date: Re: Error -10000 for one user
  • Next by Date: Re: Unable to target a specific UI element in Preview.app
  • Previous by thread: Re: Proposal: sanity for AppleScript error numbers?
  • Next by thread: Re: Unable to target a specific UI element in Preview.app
  • Index(es):
    • Date
    • Thread