SJ1:
Hi,
First of all: if solution suggested by shankar_r works for you then it's fine.
Technically it must work, though there is one peculiarity that was already mentioned before but not explained in detail.
Preface:
TestComplete addresses objects in two modes. I call them explicit and implicit ones.
Explicit mode is when you address some object by its exact path within objects hierarchy. E.g. Aliases.jp2launcher.SwingObject("..."). In this case it is assumed that all objects along the hierarchy (jp2launcher and other intermediate objects that are skipped in the Aliases tree but are present in the NameMapping one) and the final object itself (SwingObject("...")) must exist. If some object along the hierarchy cannot be found, then this is considered as a problem and reported as an error to the test log.
Implicit mode is when objects are addressed not directly, but via their complimentary .WaitXXX() methods. This mode must be used when either you don't know if the given object exists at the moment or when it is OK if the object does not exist. Example of implicit addressing: Aliases.WaitChild('jp2launcher').WaitSwingObject("..."). If WaitXXX() method cannot find the sought for object, then an empty stub is returned with the only .Exists property set to False, so that you can check whether or not the object was found. Note, that if the object was not found, the returned stub will not contain .WaitXXX() method and 'chained' search for subsequent object will fail with the 'Method not found' error posted to the log. Thus you must check search result on the object-by-object base.
Now back to your case:
Eval() function does not return any information if some problem occurs within the code executed as its argument. Thus, if your parameter string is 'Aliases.jp2launcher.SwingObject("...")' and the search for jp2launcher fails within eval(), you will not obtain any useful information back but will just get an empty stub (or exception).
Likewise, even if you have parameter string as 'Aliases.WaitChild('jp2launcher').WaitSwingObject("...")' and jp2launcher object does not exist, you still will get an empty stub and still will not be able to figure out the real reason - whether this happened because the sought for object was not found (SwingObject("...")) or because some object along the search path did not exist and thus there was even no attempt to search for the final target object.