I want to avoid any links that contain “xyz” or “rss” or “abc” and I want only those links which contain “pqr” (but those containing “pqr” must not contain “xyz”, “rss” or “abc”)
tell application "Safari" to set current_link to do JavaScript "document.links[" & i & "].href" in document 1
.....
if current_link does not contain "xyz" and current_link does not contain "rss" and current_link does not contain "abc" and current_link contains "pqr" then
The above is not a complete script. It works but I want to avoid writing “does not contain” / “contain” and instead create a list like
property theexclusions : {"xyz", "rss", "abc"}
property theinclusions: {"pqr"}
and then do something like:
if theexclusions is not in current_link and theinclusions is in current link then....