Can I use a google sheets document that calculates the size of a book spine to open a Adobe Indesign document at that size

I have a boo spine caulator on google, it uses page numbers and paper stock to calculate the size of a book spine in a seprate feild. If i added a page size column would there be a way to add a button with a script that could then open up the correct size document in Adobe Indesign… eg an a4(297mmx210mm) page with a 2mm could open a document at 297×422 (double page spread with spine added).

I havent had much luck so far using chatgpt for answers