Hi everyone,
I have a roofing company that offers multiple products. We use a numbers spread sheet to quote everything, and then when a customer chooses a roofing system, we delete a ton of the erroneous information, fill out our work orders, our sub contractor pay outs, supplier PO’s etc. This is all very tedious and mostly predictable. I have written a script that uses lots of if then logic to decide what to keep and what to delete, etc. but after getting it all working, its a hot mess. There are so many erroneous variables in the script for the different manufacturers, shingle types etc. that any time something changes with a product, for example, it is a search to try and find what I need to change in the script. There is also, not going to lie, a touch of OCD on my part wanting to get things “just right.” This brings me to the new idea…
There are some variables that will apply to every project regardless of what shingle the customer chooses (Address, Name, Phone number etc.)–(High level variables), some variables that will only apply to the manufacturer chosen (Underlay names, warranty options etc.)–(Mid level variables) and some variables that will only apply to the product (Colour, etc.)–(low level variables)
I would like to write the main script that will take all the High Level variables and offer choices that will then trigger other scripts that are specific to the mid and low level variables. The issue I am having is when it comes to getting the variables from the low and mid level scripts to feed into the high level one.
simple example
Script 1
tell application “numbers”
activate
tell table 1 of sheet 1 of document 1
set Shingle to ¬
(choose from list {“GAF”, “CRC”}
end
end
if manufacturer is equal to “GAF” then
load script Script2 (I would input the proper path obviously)
end if
display dialog StarterStrip
Script 2
—GAF options
set StarterStrip to “Weather Blocker”
(other variables)
end
when I do get script2 to load into Script1, it wither says that it can not get the variable, or the variable is undefined. If I set “as string” up it will bring back the result of script2.
Any ideas and help would be greatly appreciated, thanks!
Ryan