I have the following relevance that finds *.url files on the desktop with the string http1.xxxxx.zzzzz.com and http2.xxxxx.zzzzz.com. I need to remove the http1. and http2. from the string.
following texts of firsts "=" of variables whose (it as lowercase contains "http1.xxxxx.zzzzz.com" OR it as lowercase contains "http2.xxxxx.zzzzz.com" ) of (find files "*.url" of ((descendant folders of it; it) of folders "desktop" of folders of folder "C:\users"))
At this point I will be happy to just get a list of the files. I changed the relevance to the following, but it does not pass the syntax check.
find files "*.url" of ((descendant folders of it; it) of folders "desktop" of folders of folder "C:\users") whose (following texts of firsts "=" of variables whose (it as lowercase contains "http1.xxx.zzz.com" OR it as lowercase contains "http2.xxx.zzz.com"))
(
find files "*.url" of (descendant folders of it; it) of of folders "desktop" of folders of folder "C:\users"
)
whose (
exists (following texts of firsts "=" of variables of it)
whose (
it as lowercase contains "http1.xxx.zzz.com" or it as lowercase contains "http2.xxx.zzz.com"
)
)
pathnames of file ((find files "*.url" of ((descendant folders of it; it) of folders "desktop" of folders of folder "C:\users")) whose (exists (following texts of firsts "=" of variables of it) whose (it as lowercase contains "http1.xxx.zzz.com" OR it as lowercase contains "http2.xxx.zzz.com" )))
That has an extra file on it. The find files inspector already returns a file object, so you can just use pahnames on it directly. Try something like:
pathnames of ((find files "*.url" of ((descendant folders of it; it) of folders "desktop" of folders of folder "C:\users")) whose (exists (following texts of firsts "=" of variables of it) whose (it as lowercase contains "http1.xxx.zzz.com" OR it as lowercase contains "http2.xxx.zzz.com" )))
(pathnames of it) of ((find files "*.url" of ((descendant folders of it; it) of folders "desktop" of folders of folder "C:\users")) whose (exists (following texts of firsts "=" of variables of it) whose (it as lowercase contains "http1.xxx.zzz.com" OR it as lowercase contains "http2.xxx.zzz.com" )))
pathnames of find files "*.url" whose (exists (variables of it) whose (it as lowercase contains "=http1.xxx.zzz.com" OR it as lowercase contains "=http2.xxx.zzz.com")) of (descendant folders of it; it) of folders "desktop" of folders of folders "C:\users"
I also rearranged the relevance a bit to make it flow from right to left a bit better and removed a bunch of unneeded parens.
This should be the same, but using descendants instead of find files:
pathnames of descendants whose(name of it as lowercase ends with ".url" AND exists (variables of it) whose (it as lowercase contains "=http1.xxx.zzz.com" OR it as lowercase contains "=http2.xxx.zzz.com") ) of folders "desktop" of folders of folders "C:\users"
descendants seems slower than find files so I wouldn’t switch, but might be useful to know how to do both.