Why are the keystrokes and click events not registering in the window?Īfter a lot of trial and error, it appears as though activate window "Save As PDF" was not truly activating the window. can you send a click event to the static text?).
Is there actually a button or checkbox that I can click (am I somehow missing something with the available click events, e.g. Similarly tell group "Reduce File Size" of group " My Computer " of UI element 1 of group 1 of group 1 of window "Save As PDF" of application process "AdobeAcrobat" of application "System Events"Ĭlick at ĭoesn't work because the click event is not occurring in the "Save As PDF" window for some reason. tell window "Save As PDF"īut the window "Save As PDF" does not appear to be coming to the front therefore, the keystrokes are not registering to that particular window.
Without a button to click, I tried getting around the issue by sending keystrokes to the window. Group 1 of group "Reduce File Size" of group " My Computer " of UI element 1 of group 1 of group 1 of window "Save As PDF" of application process "AdobeAcrobat" of application "System Events" Text field 1 of static text "Reduce File Size" of group 1 of group "Reduce File Size" of group " My Computer " of UI element 1 of group 1 of group 1 of window "Save As PDF" of application process "AdobeAcrobat" of application "System Events" Static text "Reduce File Size" of group 1 of group "Reduce File Size" of group " My Computer " of UI element 1 of group 1 of group 1 of window "Save As PDF" of application process "AdobeAcrobat" of application "System Events" The output suggests this element is not a button or checkbox: group "Reduce File Size" of group " My Computer " of UI element 1 of group 1 of group 1 of window "Save As PDF" of application process "AdobeAcrobat" of application "System Events" My first step was tracking down all the elements in the window with set allElem to entire contents of window "Save As PDF".
Which, according to Accessibility Inspector, has the following hierarchy:
#How to reduce size of pdf acrobat reader pro
I am trying to use AppleScript to open a PDF in Adobe Acrobat Pro and reduce the file size using the "Reduce File Size" option when saving the file.