Re: System Events OK Button Problem
Re: System Events OK Button Problem
- Subject: Re: System Events OK Button Problem
- From: Rick Gordon <email@hidden>
- Date: Fri, 24 Feb 2012 03:26:30 -0800
Title: Re: System Events OK Button
Problem
Yes, I am able to trigger the OK button with manual return or
enter. Just tried in CS5.5.
------------------
On 2/24/12 at 11:38 AM +0100, Jan-Bultereys wrote in a message
entitled
"Re: System Events OK Button Problem":
hi Rick,
Have done the test in CS4 and CS5 works
without any problem.
Are you able to submit the OK button
hitting the return key manually?
If that's not the case, something has
been messed up on your system or in ID.
best regards,jan
On Feb 23, 2012, at 10:50 PM, Rick Gordon
wrote:
Nope. The dialog OK is not submitted by
either:
keystroke return
keystroke enter key
key code 36
targeted mouse clicks via System
Events
or
mouse clicks using MouseTools (shell
command)
...even with delays and/or
loops
Yet QuicKeys did it. InQK, when choosing
a click, there are two options:
1) Tell button to click itself. (May not
work with some Carbon applications)
and
2) Click button (May fail if button is
covered by another window)
The second option worked, and I'm
guessing it may relate to the Carbon thing, since InDesign is built
with Carbon libraries.
So what finally worked was this, where I
actually moved more of the work to QK:
tell application "Adobe InDesign
CS5.5"
activate
end tell
tell application "System
Events"
tell
application process "Adobe InDesign CS5.5"
set vEditMenu to menu "Edit" of menu bar 1
set
vConvertToProfileMenuItem to menu item "Convert to Profile..."
of vEditMenu
click vConvertToProfileMenuItem
--LOOP TO MANAGE FIRST-LOAD
DELAY
set
vSuccess to false
try
repeat while vSuccess is false
delay 1
set
vConvertToProfileDialog to window "Convert to Profile"
set
vSuccess to true
end
repeat
end
try
end tell
end tell
tell application "QuicKeys"
play shortcut named
"Convert to Profile - GRACoL2006_Coated1v2" without
queuing
end tell
Rick Gordon
------------------
On 2/23/12 at 2:20 PM +0100, email@hidden wrote in a message entitled
"Re: RE: System Events OK Button
Problem":
hi Rick, what exactly does not work...
does this not do the trick?
tell application "Adobe InDesign
CS5.5"
activate
end tell
tell application "System
Events"
tell application process "Adobe
InDesign CS5.5"
set vEditMenu to menu "Edit" of menu bar 1
set vConvertToProfileMenuItem to menu item "Convert to
Profile..." of vEditMenu
click vConvertToProfileMenuItem
set vConvertToProfileDialog to window "Convert to Profile"
tell vConvertToProfileDialog
set vAppliedCMYK to pop up
button 2
click vAppliedCMYK
delay 2
keystroke "U.S. Web Coated (SWOP) v2" &
return
delay 2
keystroke return
end tell
end
tell
end tell
best regards,jan
This finally seems to have emerged here
today after having been sent out last week. I've had conversations
concerning it on the InDesign AppleScripting list, and after trying
different System Events-based approaches that didn't work, finally got
QuicKeys to do what I couldn't script.------------------On 2/21/12 at
1:28 PM -0800, Rick Gordon wrote in a message entitled"System
Events OK Button Problem":>I'm trying to script an InDesign
dia log response for which there is no direct application access (the
"Convert to Profile.." command), so I'm using System Events.
I've got everything working, except that none of the approaches for
accepting and dismissing the dialog is working (as commented
below).>>What's my problem here? (OS
10.6.8)>>-->>tell application "Adobe InDesign
CS5.5"> activate>end
tell>tell application "System
Events"> tell
application process "Adobe InDesign
CS5.5">
set
vEditMenu to menu "Edit" of menu bar
1>
set
vConvertToProfileMenuItem to menu item "Convert to Profile..."
of vEditMenu>
click
vConvertToProfileMenuItem>
set
vConvertToProfileDialog to window "Convert to
Profile">
tell
vConvertToProfileDialog>
set
vAppliedCMYK to pop up button 2>
click vAppliedCMYK>
keystroke "U.S. Web Coated (SWOP) v2" &
return>
>
keystroke enter key --NOT
WORKING>
--OR>
key
code 36 --NOT WORKING>
--OR
>
perform action "AXPress" of button "OK"
--NOT WORKING,>
--CONFIRMED THAT BUTTON AND ACTION
EXISTS>
>
end
tell> end
tell>end
tell>-->___________________________________________________>>RICK GORDON>EMERALD VALLEY GRAPHICS AND
CONSULTING>___________________________________________________>>WWW:http://www.shelterpub.com>
_______________________________________________>Do not post admin
requests to the list. They will be ignored.>AppleScript-Users
mailing list (email@hidden)>Help/Unsubscribe/Update
your
>users/email@hidden>Archives: http://lists.apple.com/archives/applescript-users>>This
email sent to email@hidden-- ___________________________________________________RICK
GORDONEMERALD VALLEY GRAPHICS AND
CONSULTING___________________________________________________WWW: http://www.shelterpub.com_______________________________________________Do not post admin
requests to the list. They will be ignored.AppleScript-Users mailing
list (email@hidden)Help/Unsubscribe/Update your
>s/email@hiddenhives:http://lists.apple.com/archives/applescript-usersThis email
sent to email@hidden
--
___________________________________________________
RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________________
WWW: http://www.shelterpub.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
0skynet.be
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
--
___________________________________________________
RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________________
WWW: http://www.shelterpub.com
_______________________________________________
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