I'm trying to write a little applescript that closes tabs that have URLs that do not contain certain text, but I can't get it to work.
Right now, my script closes every tab regardless of the URL. When it should only close specific URLs.
Can anyone tell me where I've gone wrong?
Here's the script…
tell windows of application "Google Chrome" to close (tabs whose URL does not contain {"business.facebook", "pinterest"} as text)
Best Answer
This works:
In an AppleScript
whose
clause you need to spell out each criteria fully and join them with a logical operator. You tried to use a list to make an implicitand
; that makes sense to the human brain, but AppleScript can't parse it.