AppleScript call function in IF statement I don't usually use function, but why can't I call a function inside an IF statement?
for example this obviously work just fine
notification()
on notification()
    display notification &quot;just a quick demo&quot;
end notification

but this doesn't :
set myOption to {&quot;demo one&quot;, &quot;demo two&quot;}
set selectedoption to choose from list myOption with title &quot;demo&quot; with prompt &quot;What's the story?&quot; default items &quot;Start Prism&quot;

if selectedoption is equal to &quot;demo one&quot; then
    notification()
end if


on notification()
    display notification &quot;just a quick demo&quot;
end notification
Your If statement isn't checking out.
Change &quot;is equal to&quot; to &quot;contains&quot;, it should catch it.
if selectedoption contains &quot;demo one&quot; then
    notification()
end if