• 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
Can I store element info in a library and access it from other scripts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can I store element info in a library and access it from other scripts


  • Subject: Can I store element info in a library and access it from other scripts
  • From: Rahul Mirakhur <email@hidden>
  • Date: Sun, 24 Aug 2008 11:32:16 +0530

Hello All,

Though I have been using Mac's for quite a few years and using AppleScripts for few basic needs, I had been troubled by a problem at work for sometime and wanted to see if I could get some kind of solution here. I am a software tester in Macintosh domain and here is my problem.

PROBLEM
I need to automate an application say "MyApp" whose UI is being worked upon while I am expected to write up the required applescripts to reduce the time taken during regression. As the time between final UI version and time to finish testing is less, I need to write the scripts as the UI is being developed and fix the scripts in case they get broken due to change in UI.

The major problem I face is my 20 odd scripts get ready and developer changes the UI layout a bit which totally breaks all my scripts and I end up sitting long hours "tweaking" all my scripts. The changes are trivial but they end up taking a lot of time. Here's an example:

Code BEFORE UI change:
click button "Click here" of group 1 of group 2 of group 1 of window "MyApp"

Code AFTER UI change:
click button "Click here" of group 1 of group 1 of group 2 of group 1 of window "MyApp"

As you can see, the change was that the button has been embedded in an additional group (initially there were 3 but then it became 4). Though this change is trivial, it affects all my scripts and I end up updating all scripts manually.

MY QUESTION
I toyed with an idea to list all my application controls in one library as variables and then refer to those variables through all of my scripts thereby, insulating me from changing them everywhere. If developer changes the UI, all I have to do is change one library and all scripts still work.

However, I am unable to implement this successfully as I can not find a way to make my scripts successfully access the control info from outside the script.
I was hoping that I would be able to do something like this:

Library: set bttnClickHere as "button \"Click here\" of group 1 of group 1 of group 2 of group 1 of window \"MyApp\""
My Script code: click Lib's bttnClickHere

This way, even if the button is embedded in another group, I have to change one variable and all my scripts remain untouched.

I am not sure if what I envision is possible or not, or if I am doing something wrong...would really appreciate any help/direction in this problem of mine.

Thanks in advance!
Rahul.
 _______________________________________________
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: Can I store element info in a library and access it from other scripts
      • From: Philip Aker <email@hidden>
  • Prev by Date: Re: INDESGN CS3: Still AfterOpen Event Problem
  • Next by Date: Shell Script Not Working from AppleScript Call
  • Previous by thread: Re. Hdiutil broken for me
  • Next by thread: Re: Can I store element info in a library and access it from other scripts
  • Index(es):
    • Date
    • Thread