I read about interleaved- handlers and parameters in handlers in Apple's documentation, but I don't know why some specific open-source code is working for others while not for me.
In the documentation of Handlers with Labeled Parameters it declares that:
These are the only labels that can be used without the special label given
But, for example, I saw this handler in some library (among many other examples):
on create special window windowTitle special width theWidth special height theHeight clicks neededClicks : 0
How and why this code is gonna work? I'm trying to execute it via "osascript" tool (using a plain-text non-compiled script file) - and not from Script Editor - without any luck.
I tried to wrap the spaced-names with vertical-bar sign, but without luck:
on |create special window| windowTitle |special width| theWidth |special height| theHeight |clicks| neededClicks : 0
But this code returns "script error: Expected “given”, “into”, “with”, “without” or other parameter name but found identifier. (-2741)".
Maybe outside of Script Editor, it's not possible to use handlers this way? Or since it's from a library it has a different syntax restrictions? Or maybe the Script Editor "hides" required syntax when copying from it?
Note, I'm not even sure the problem is whitespace, or the lack of the "given"-label keyword, or maybe a missing colon trying to be parsed as "Interleaved Parameter", but I see code like this anywhere and can't understand why it's working.
Other way to ask the same question: how "display dialog" built-in command's handler is defined? how it works with whitespaces in the command name and parameters?
You can define multiword name functions with multiword labels using the given keyword and pipes. Here the function name is "|create special window|" :