Indesign - relink .indd with different page

I have a indesign file (called basesheet.indd) placed on a master page as a link within another Indesign file (called template.indd). baseheet.indd has several pages with different colour combinations. I need to write a script to relink basesheet.indd, to a different page within the same document. Not sure if this can be done, but certainly not working so far.

This is what I have at the moment:

tell application "Adobe InDesign CS6"
	activate
	
	tell front document
		
		try
			relink link "basesheet.indd:2" to alias "Volumes:Works Server:#####:MASTER ITEMS:templates:BASESHEET:basesheet.indd:4"
		end try
		
	end tell
end tell

Hi. I can only offer a partial answer. I doubt if a specific page can be linked on relink; that seems more likely to be a place function, but it might be possible in your version. A problem I see with your script is that you’re attempting to link to a string”the link’s name.

tell application "InDesign CS"'s document 1
	relink (links whose name is "basesheet.indd") to "Volumes:Works Server:#####:MASTER ITEMS:templates:BASESHEET:basesheet.indd"
end tell

You will probably have to place the documents again, rather than relinking them. You control which page gets placed via the page number property of imported page attributes:

tell application id "com.adobe.InDesign"
	set page number of imported page attributes to 4 -- whatever
	-- now place document again
end tell

Thanks Marc and Shane, much appreciated.
Just need to work out how to place object on master page in right spot. Thinking now it’s probably easier to separate basesheet.indd into individual indesign files.