I want to call a handler with the parameters set by name.
If I do so inside the same script, I have no problem. If I try to call it with the folder and script name the input is seen as a property list like this: {string1:“Text to join”, string2:" with this ending."}.
Example:
Handler in the script “TestScript” in the Folder “Test”
put JoinStrings(string1:"Text to join", string2:" with this ending." by name) into joinedString
Log joinedString
To handle JoinStrings with string1, string2
return string1 & string2
End JoinStrings
Calling the script, results in the required behavior.
Calling the function like below, results in the return of the property list
put "Test/TestScript".JoinStrings(string1:"Text to join", string2:" with this ending." by name) into joinedString
If I then put the string of Test/TestScript into a variable and run it like below it works again.
put "Test/TestScript" into foobar
Log (foobar).JoinStrings(string1:"Text to join", string2:" with this ending." by name)
How can I use my handler in this case without setting a variable first?