-- (C)opyright 2017-12-15 Dirk Holtwick, holtwick.it. All rights reserved.

tell application "Bank X"
    tell document 1
    set acc to accounts
    if (count of acc) > 1 then
        set names to id of every account
        set n to (choose from list names with prompt __TITLE__ default items "None" OK button name {__OK__} cancel button name {__CANCEL__})
        -- choose from list cancel button returns false, not -128, as do other choose syntax do.
        
        if n is false then error number -128 -- user canceled
        set sourceAcc to first account whose name is n as string
        else
        set sourceAcc to first account
    end if    
    create order cent __CENT__ currency "EUR" source account sourceAcc subject one __LINE1__ subject two __LINE2__ client name __CLIENT__ client number __IBAN__ country "DE" type "sepatransfer"
    end tell
end tell

-- set sourceAcc to first account of document 1 whose name is "Testkonto"
