Action script; nested relevance - need some help

The wait command works, but the if statement does not, it does not like the syntax, I think the issue is the nested relevance in the if statement?

if {exists file “C:\ProgramData\Package Cache{name of key whose (value “displayname” of it as string contains “Snagit” of it) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry}\Bootstrapper.exe”}
Wait “C:\ProgramData\Package Cache{name of key whose (value “displayname” of it as string contains “Snagit” of it) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry}\Bootstrapper.exe” /uninstall /quiet
endif

I won’t be able to test at the moment but Relevance replacements don’t embed in this way; instead, you’d have one Relevance statement that builds the string, where the portions of the pathname string can be a concatenation, as in

if {exists file ("C:\ProgramData\Package Cache\" & name of key whose (value "displayname" of it as string contains "Snagit" of it) of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry & "\Bootstrapper.exe")}

that did not work, I still get a evaluation error, but I see what you are saying.

It will throw an evaluation error if there is no registry value referencing ‘Snagit’ or if there are more than one. You’d have to refactor the statement as a whole to handle the potential ‘Singular Expression’ errors.

Here’s one, based on a different product that I have…

q: exists files "Bootstrapper.exe" of folders (names of keys whose (value "displayname" of it as string contains "BigFix Client" of it) of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) of folders "C:\ProgramData\Package Cache"

Then to reference the bootstrapper.exe path you could use

q: pathnames of files "Bootstrapper.exe" of folders (names of keys whose (value "displayname" of it as string contains "Intel(R) Graphics Driver Software" of it) of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) of folders "C:\ProgramData\Package Cache"

I did have some issues testing this though, I don’t have a ‘bootstrapper.exe’ file in any of my Package Cache folders, and I find several of the Package Cache folders reference both the package name and version, so this may be a bit fragile of a statement.

Ok, thank you for the help.