Reputation: 1261
Is there a difference between the on
and to
keywords when declaring functions in applescript? Seems like they're interchangeable from what I've seen. Is that the case or would one be more useful than the other in some situations?
Upvotes: 1
Views: 2308
Reputation: 27613
on
and to
are equivalent. See https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_handlers.html:
( on | to ) handlerName ¬
[ [ of | in ] directParamName ] ¬
[ ASLabel userParamName ]... ¬
[ given userLabel:userParamName [, userLabel:userParamName ]...]
[ statement ]...
end [ handlerName ]
Upvotes: 1