1) Looking for any advice and tips on breaking my script down into handlers.
I definitely realize I am reusing segments over In different places in my script that I could breakout into Seperate handlers.
This handler would get passed 3 variables. {list1, list2, string3}
In my previous usage depending on what string3 was it would process the data differently,
sometimes creating a 4th string Variable to be used.
2) question:
2A) should I create 2 new seperate handlers then.
2A-H1)
On evaluateSTRING3{string3}
–evaluates string3 variable.
–some if/thens
– creates new string4 variable
return string4
End evaluateSTRING3
Then I can simpfly the new main handler so that it just processes
2A-H2)
On newMAINHANDLER(list1, list2, string4)
–process the data
–without any if ands or buts (hehe)
End newMAINHANDLER
3) Now how should I best “call” these handlers?
3A-H3) with a 3rd separate handler
set theMAINRESULTS to my processTHEDATA (list1, list2, string3)
On processTHEDATA (list1, list2, string3)
set string4 to my evaluteSTRING3(string3)
set theResults to my newMAINHANDLER(list1, list2, string4)
return theResults
end processTHEDATA
or 3A-H2-B insert the evaluteSTRING3 handlers into the newMAINHANDLER
set theMAINRESULTS to my newMAINHANDLERV2 (list1, list2, string3)
On newMAINHANDLERV2(list1, list2, string3)
set string4 to my evaluteSTRING3(string3)
–process the data with string4
–without any if ands or buts (hehe)
End newMAINHANDLERV2
or 3B in my main script have 2 separate call lines
set string4 to my evaluteSTRING3(string3)
set theMAINRESULTS to my newMAINHANDLER (list1, list2, string4)
4) Overall is there any advantage / disadvantage to create Handlers that just call other handlers?
5) This just came to me… is there anyway to have a handler execute a list of handlers passed to it?
for my script I’m seeing there being 3 main operations that my script will do for them.
I want to offer them the Choose from List. Of on of those 3 processes. Then based on that
selection can I pass a handlers a list of handlers to execute?
property handlerSET1 : {my setupVARHANDLER1, my getDATAHANDLER1, my processDATAHANDLER1, my selectDATAHANDLER1, my processDATAFURTHER1, my showRESULTS}
property handlerSET2 : {my setupVARHANDLER2, my getDATAHANDLER2, my processDATAHANDLER1, my selectDATAHANDLER2, my processDATAFURTHER1, my showRESULTS}
property handlerSET3 : {my setupVARHANDLER2, my getDATAHANDLER3, my processDATAHANDLER1, my selectDATAHANDLER3, my processDATAFURTHER2, my showRESULTS}
set fullHANDLERSET to (handlerSET1, handlerSET2, handlerSET3)
set pickOPERATION to choose from list {“Process 01”, “Process 02”, “Process 03”}
set theTORUNSET to pickOPERATION
my runaLISTOFHANDLERS(theTORUNSET)
this would be awesome if possible.
??? as a script object ???
tell myrunaLISTOFHANDLERS to theTORUNSET