The bug happened because AppleScript's do JavaScript is synchronous. It returns immediately, without waiting for async work to finish. This means that if you pass an async function to do JavaScript, ...
Functions do nothing until you call them. Calling a function means you tell the computer to run that specific code block. Why you need functions: - You reuse code without rewriting it. - You organize ...