Edit watch me do after recording and then integrate again

Hi All,

I am a new bee to Automator. I am trying to automate testing for an application whose UI controls, most often, are not identified by Automator. Therefore automator uses statements of the sort "UI element 1 of UI element 1 of scroll area 1 of......" and so on. Therefore, I cannot write these scripts on my own ( or please guide me if I can). So, I record an action which is a combination of steps. From this "watch me do" I drag out a step to see its script. Now I want to do similar things:
This records actions in a window names untitled1. I would like to edit this name in the script to "any title".extn (How can I do this?) Now I want to integrate this edited step back to its original location in watch me do.
TIA!
regards,
vb

Mac OS X (10.5.2)

Posted on Jun 1, 2009 4:43 AM

Reply
3 replies

Jun 1, 2009 8:14 AM in response to v._.b

Some of the GUI items have names, but it is up to the developer of the application to give names to them. Not everything has a name, but they do have index numbers, which is what you are seeing. For application windows, if you are wanting to target the front window, not necessarily the one named "Untitled1", the frontmost window is window 1.

There is an Accessibility Inspector application in the Developer Tools that can be used to look at the various GUI items - AppleScript can also be used for GUI scripting, there is more information on Apple's macosxautomation page.

Jun 2, 2009 2:28 AM in response to red_menace

Thanks a lot! Accessibility Inspector (AI) is what I was searching for. I thought of using the Dictionary of "Script Editor", but my application was not listed among scriptable apps there. Thanks for this.
Now the issue is the application does not expose any controls.
I am not sure how automator recognizes the controls while replay, but AI does not show any different names for the controls on stage. Moreover, on looking at the script recorded by Automator, I see all the elements named as UI element 1.

Now knowing the fact that elements are not identified, I tried using keyboard to complete actions. But automator does not recognize tab, return etc. Can I do this using scripts.

My previous questions still remain:
Can I edit apple script of a step in automator action and integrate it back to the action? If yes How?
And how can I edit the name of window in applescript of a step from say "untitled.rtf" to "*.rtf"

cheers,
vb

Jun 2, 2009 5:47 AM in response to v._.b

I don't think you can put an edited step back into the Watch Me Do action, but you can use a Run AppleScript action to edit and run the code for the step(s) directly. For that matter, you don't really need Automator at all, a regular AppleScript can use System Events to script the GUI. The Accessibility Inspector should give you the hierarchy of the various objects.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Edit watch me do after recording and then integrate again

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.