Forum Discussion
sbkeenan
11 years agoFrequent Contributor
Hi Vikraman
I think you need to use one of the waitChild/waitAliasChild type methods.
When checking the Exists property of an object, if that object doesn't exist, teh Exists property, by definition, doesn't exist either, hence your error in the log file.
If you're your using Aliases, then use the waitAliasChild method, something like this:
Basically, the above waitAliasChild method will check for the existence of the object and will continue to do so for 5 seconds. If after 5 seconds, the object doesn't exist, a stub object with only one property (the Exists property) is returned, which will be set to false, meaning that the statements in the Else clause will be executed. If, however, the object is found within the 5 second time limit, the script will immediately act on the appropriate statements for teh 'true' part of the If statement.
Hope this helps.
Regards
Stephen.
I think you need to use one of the waitChild/waitAliasChild type methods.
When checking the Exists property of an object, if that object doesn't exist, teh Exists property, by definition, doesn't exist either, hence your error in the log file.
If you're your using Aliases, then use the waitAliasChild method, something like this:
If (<processName>.waitAliasChild("<objectName>", 5000).Exists)
'do something here
Else
'Object doesn't exist - do something else here
End If
Basically, the above waitAliasChild method will check for the existence of the object and will continue to do so for 5 seconds. If after 5 seconds, the object doesn't exist, a stub object with only one property (the Exists property) is returned, which will be set to false, meaning that the statements in the Else clause will be executed. If, however, the object is found within the 5 second time limit, the script will immediately act on the appropriate statements for teh 'true' part of the If statement.
Hope this helps.
Regards
Stephen.
Related Content
Recent Discussions
- 3 days ago
- 3 days ago
- 6 days ago