Please check the reference: Pass arguments from one doc to another through custom client script/custom button - #2 by NCP