I have the following relevance that seems to work ok, but is not very straight forward to read. Is there a better way to write this relevance so that it would be more intuitive?
sha1 of file "Time Entry.url" of folder "Desktop" of ((folder "Users\Public" of folder (value of variable "SystemDrive" of environment)) | (folder (value of variable "AllUsersProfile" of environment))) as string | "not exist" != "72d4fe1dae848b8bd070d21858b18fe92114c342"
I’m not clear exactly what you are trying to do as far as which folders to check. You should use plurals and semi-colons instead of pipes to check multiple folders at once. You should always use plural relevance, unless you can’t for comparison reasons.
(folders "Desktop" of it; folders "Links" of it) of folders of folders "Users" of root folders of drives of system folders
files "Time Entry.url" whose("72d4fe1dae848b8bd070d21858b18fe92114c342" = sha1 of it) of (folders "Desktop" of it; folders "Links" of it) of folders of folders "Users" of root folders of drives of system folders
not exists file "Time Entry.url" whose(sha1 of it = "72d4fe1dae848b8bd070d21858b18fe92114c342") of (value "Common Desktop" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" of registry as folder)
files "Time Entry.url" of folders "Desktop" of (folders "c:\Documents and Settings\All Users"; folders "c:\Users\Public")
If I’m using the registry location, I typically do it something like this:
files "Time Entry.url" of (folder it) of unique values of (it as string) of values "Common Desktop" of keys "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" of (x64 registries; x32 registries)
I prefer to preserve the right-to-left reading of relevance when possible.
I didn’t have to, but I am checking both the x64 registry and the x32 registry, which could result in 2 returned values instead of one if the value exists in both.