Zuhaib Zuhaib - 6 days ago 5
AppleScript Question

How to invert if condition in applescript with multiple expression

I have the following script working fine:

if {title is equal to "missing value" or title starts with "Your stream on"} then
return ""
else
try
return "♫ " & title
on error err
end try
end if


I want to invert this if condition into something like this:

if {title is not equal to "missing value" or not title starts with "Your stream on"} then
try
return "♫ " & title
on error err
end try
end if

Answer

Actually the correct logical inversion of

a OR b

is

not a AND not b

And no braces and AppleScript speaks real English

if title is not missing value and title does not start with "Your stream on" then