0

Since Yosemite or thereabouts, it's been possible make an AS handler parameter optional simply by declaring a default value for it:

to Make_New_Terminal into termType : "Tab"
    blah blah
end Make_New_Terminal

If, however, a handler has only one parameter, how does one call it without specifying a value for that parameter?

Make_New_Terminal

and

Make_New_Terminal()

of course both fail.

I'm guessing the answer is, as usual, "You can't." AS is, after all, Apple's starved and abandoned stepchild, left out in the cold to die like something out of Victor Hugo. Of course, again like a character out of Les Mis, there are always a dozen hideous urchin workarounds lacking hair, teeth, or dignity. We needn't go there.

Optimism being an intractable vice, I thought I'd ask, just the same.

2
  • 1
    While AppleScript does have optional parameters, it doesn't have handlers where everything is optional - if parameters are defined, at least one needs to be used, even if it is something like an empty record, with/without, or missing value. Do you have something more specific in mind?
    – red_menace
    Commented Jun 3, 2022 at 3:52
  • Not really. I simply wanted to be sure. Thanks for confirming what I suspected. Commented Jun 4, 2022 at 22:27

0

You must log in to answer this question.

Browse other questions tagged .