Hi All,
I’m writing a script to automate filling in legal forms and have hit a wall. There is a field of check boxes (20+) of which only 1 needs to be checked on each form. I’ve figured a way to do this by only asking two questions. The first asks to select from a list of headings (case type), choosing one should cause one of four other lists to appear to ask for choices and I can’t seem to get it to work. i’m sure I’m missing something simple, but have been giving my computer very nasty looks for several hours on this one and after much searching have finally resorted to asking for help.
The display dialog at the end was just to help see the value that was returned.
Any and all help is appreciated and can lead to a cold beer the next time you’re in Vegas.
Thanks in advance.
- Jim
set case_type to {"DOMESTIC", "MISC. DOMESTIC RELATIONS PETITIONS", "GUARDIANSHIP", "PROBATE"}
set dom_case to {"Annulment", "Divorce - No minor child(ren)", "Divorce - with minor child(ren)", "Foreign Decree", "Joint Petition - No minor child(ren)", "Joint Petition - With minor child(ren)", "Seperate Maintenance"}
set misc_case to {"Adoption - Minor", "Adoption - Adult", "Mental Health", "Name Change", "Paternity", "Permission to Marry", "Temporary Protective Order (PTO)", "Termination of Parental Rights", "Child Support/Custody", "Other"}
set guard_case to {"Guardianship of person (adult)", "Guardianship of estate (adult)", "Guardianship of person and estate (adult)", "Guardianship of person (minor)", "Guardianship of estate (minor)", "Guardianship of person and estate (minor)", "Guardianship Trust"}
set prob_case to {"Summary Administration", "General Administration", "Special Administration", "Set Aside Estates", "Trust/Conservatorships", "Individual Trustee", "Corporate Trustee", "Other Probate"}
set case_box to {choose from list case_type with prompt "Select the type of case being filed..."}
if case_box contains {"DOMESTIC"} then
set dom_type to {choose from list dom_case with prompt "Select type of dissolution."}
else if (case_box = "MISC. DOMESTIC RELATIONS PETITIONS") then
set misc_type to {choose from list misc_case with prompt "Select type of dissolution."}
else if (case_box = "GUARDIANSHIP") then
set guard_type to {choose from list guard_case with prompt "Select type of dissolution."}
else if (case_box = "PROBATE") then
set prob_type to {choose from list prob_case with prompt "Select type of dissolution."}
end if
-- display dialog to show variable chosen
display dialog "you chose " & case_box
AppleScript: 2.0.2
Browser: Safari 530.19
Operating System: Mac OS X (10.5)