InDesign-Update Library Placeholder

Hey Guys,
I am having an issue with a script.
Originally places boxes required by the user, then checks the links folder for a new barcode and updates it in the library placeholder box.
But it is copying the placeholder image to the links folder and not using the updated file in the links folder.

The initial script is not mine, i have only been given the task to rewrite certain requirements.
But i know the items updated in the library may be the issue, but i am not sure or even how to fix them…


global myH, myW, myB, theDoc, my2upH, thePDF, topRot, botRot, mySpine, spSize, theMessage, myDialog, Create2up, myContinue, myPDF, theDoc, my2upW, my2upH, myNonPrint, NonPrint, npSize, topRectangle, botRectangle, TheFirst, theISBN, The1, The2, The3, The4, The5, myBCorBF, myKorW, myWFSP, myWFFC, theFrameTest, theFramecolor, myKW, theFile, theName, theList, thecopy, thisLink, thenewpath, theExist, myCCC, theoldorig, MyP, theDialog, theResult, myCCCBC, myWFBC, thejob, thejobs, thejob1, thejob2, thejob3, thebarcode, k, theUnusedSwatches
set theDoc to {}

--Setting the path to the folder where library files are stored
--Replace with the path where you saved the library files
set library_path to path to desktop as string

tell application "Adobe InDesign CC 2019"
	
	--Getting a list of every library
	set the_libraries to library
	
	--Opening the library
	--set pathtoLibFile to ((path to desktop folder) & "_Scholastic Libraries:") as string
	--set the_libraries to "SCH Library" & ".indl" as string
	--set theDoc to open (pathtoLibFile & "SCH Library" & ".indl")
	
	activate
	set myDW to 0
	set spSize to 0
	set setspineSize to 0
	set myB to 0
	set bleedamount to 0
	set myW to 0
	set coverWidth to 0
	set myH to 0
	set coverHeigth to 0
	set myBCorBF to 0
	set myBCBF to 0
	set myKW to 0
	set myKorW to 0
	set myWFSP to 0
	set myWframeSP to 0
	set myWFFC to 0
	set myWframeFCP to 0
	--
	if not (exists library "SCH Library.indl") then
		set dialogTitle to "Choose your InDesign Version"
		set theDialog to display alert "Select the Correct InDesign Version" buttons {"2019 V14", "2020 V15", "2021 V16"} default button "2019 V14" giving up after 10
		
		if button returned of theDialog = "2019 V14" then
			set pathtoLibFile to ((path to desktop folder) & "_Scholastic Libraries:2019 V14:") as string
			set the_libraries to "SCH Library" & ".indl" as string
			set theDoc to open (pathtoLibFile & "SCH Library" & ".indl")
			
		else if button returned of theDialog = "2020 V15" then
			set pathtoLibFile to ((path to desktop folder) & "_Scholastic Libraries:2020 V15:") as string
			set the_libraries to "SCH Library" & ".indl" as string
			set theDoc to open (pathtoLibFile & "SCH Library" & ".indl")
			
		else if button returned of theDialog = "2021 V16" then
			set pathtoLibFile to ((path to desktop folder) & "_Scholastic Libraries:2021 V16:") as string
			set the_libraries to "SCH Library" & ".indl" as string
			set theDoc to open (pathtoLibFile & "SCH Library" & ".indl")
		end if
		
	else
		my myDialog()
		if theResult = false then
			error number -128
		else
			my myContinue()
			my myplaceitems()
			my mySave()
			save theDoc to theFile & theName as string
			
			if theExist is true then
				display dialog "The document " & theName & " was created because file name alreasy exist in folder, also graphics copied." giving up after 10
			else
				display dialog "The document " & theName & " was created and graphics copied." giving up after 10
			end if
			
		end if
	end if
	--end if
	
end tell

on mySave()
	set theSave to choose folder with prompt "Save document to Cover folder"
	tell application "Finder"
		set AppleScript's text item delimiters to ""
		set myW to 0
		set myH to 0
		set myB to 0
		set myDW to 0
		set theFile to theSave as text
		set AppleScript's text item delimiters to ":"
		set theISBN to fifth text item of theFile as text
		
		---test for "SCH EDU"
		set AppleScript's text item delimiters to ":"
		set theSCHEDU to 2nd text item of theFile as text
		if theSCHEDU = "SCH EDU" then
			set theISBN to fourth text item of theFile as text
			set thejob to 3rd text item of theFile as text
			set AppleScript's text item delimiters to " "
			set thejob1 to 1st text item of thejob as text
			set AppleScript's text item delimiters to "-"
			set thejob2 to thejob1
			set AppleScript's text item delimiters to "-"
			set thejob3 to thejob1
		else
			set theISBN to fifth text item of theFile as text
			set thejob to 4th text item of theFile as text
			set AppleScript's text item delimiters to " "
			set thejob1 to 1st text item of thejob as text
			set AppleScript's text item delimiters to "-"
			set thejob2 to 1st text item of thejob1 as text
			set AppleScript's text item delimiters to "-"
			set thejob3 to 2nd text item of thejob1 as text
			set thebarcode to thejob2 & "0" & thejob3 & "_ISBN-" & theISBN & ".pdf" as text
		end if
		set theName to "FC_BC_" & theISBN & "." & "indd" as text
		
		---checking for InDesign file existing
		if exists (theFile & theName) then
			set theName to "FC_BC_" & theISBN & "_new" & "." & "indd" as text
			set theExist to true
		else
			set theExist to false
		end if
		
		--links copy
		set thenewpath to (theFile & "" & "Links") as text
		set AppleScript's text item delimiters to ""
		my myLinks()
	end tell
end mySave

on myLinks()
	tell application id "com.adobe.InDesign"
		set theDoc to active document
		tell theDoc
			--set stroke weight to 0
			set theLinks to every link
			repeat with i from 1 to count of theLinks
				set theLinkname to name of item i of theLinks
				--try --if status of item i of theLinks is not link missing then
				set thisLink to theLinkname
				if thisLink is "9780545693851_CTSD_EAN.eps" then
					set thisLink to thebarcode
				end if
				try
					if exists (thenewpath & ":" & thisLink) then
						relink of item i of theLinks to (thenewpath & ":" & thisLink) as alias
					end if
				end try
				
				--97130055_ISBN9780545814287-5.99.pdf
				if thisLink is "97130055_ISBN9780545814287-5.99.pdf" then
					repeat with k from 1 to 32
						set theBFbarcode to thejob2 & "0" & thejob3 & "_ISBN-" & theISBN & ".pdf"
						set thisLink2 to theBFbarcode
						try
							if exists (thenewpath & ":" & thisLink2) then
								relink of item i of theLinks to (thenewpath & ":" & thisLink2) as alias
								set horizontal scale of i of theLinks to 99
								set vertical scale of i of theLinks to 99
							end if
						end try
					end repeat
				end if
			end repeat
			--other links

			---- place white frame logo
			repeat with i from 1 to count of theLinks
				set theLinkname to name of item i of theLinks
				try --if status of item i of theLinks is not link missing then
					set thisLink to theLinkname
					if thisLink is "RedBar.WWW.lockup.black.eps" then
						if myWFBC is true then
							set thisLink to "RedBar.WWW.lockup.black.OL.eps"
						end if
					else if thisLink is "RedBar.WWW.lockup.white.eps" then
						if myWFBC is true then
							set thisLink to "RedBar.WWW.lockup.white.OL.eps"
						end if
					end if
					-----
					my myCopy()
					relink of item i of theLinks to (thenewpath & ":" & thisLink) as alias
				end try
			end repeat
		end tell
	end tell
end myLinks

on myCopy()
	tell application "Finder"
		set thecopy to "Logos:" & thisLink
		if exists (thenewpath & ":" & thisLink) then
		else
			duplicate file thecopy to thenewpath
		end if
	end tell
end myCopy

on myDialog()
	tell application id "com.adobe.InDesign"
		tell view preferences --of application
			set horizontal measurement units to inches
			set vertical measurement units to inches
			set theoldorig to ruler origin
			set ruler origin to spread origin
		end tell
		set theDialog to make dialog with properties {can cancel:true}
		tell theDialog
			set name to "Document specs"
			set myDialogColumn to make dialog column
			tell myDialogColumn
				set myBorderPanel1 to make border panel
				tell myBorderPanel1
					make static text with properties {static label:"Spine Width:"}
					set mySpine to make dialog column
					tell mySpine
						set spineSize to make measurement editbox with properties {edit value:36, edit units:inches, small nudge:0.1, minimum value:0, maximum value:288, min width:0}
					end tell
				end tell
				--
				tell myBorderPanel1
					make static text with properties {static label:"      Bleed Amount:"}
					set myBleed to make dialog column
					tell myBleed
						set bleedamount to make measurement editbox with properties {edit value:9, edit units:inches, small nudge:0.1, minimum value:0, maximum value:288, min width:0}
					end tell
				end tell
				--
				set myBorderPanel2 to make border panel
				tell myBorderPanel2
					make static text with properties {static label:"Cover Width:"}
					set myCW to make dialog column
					tell myCW
						set coverWidth to make measurement editbox with properties {edit value:378, edit units:inches, small nudge:0.1, minimum value:1, maximum value:2000, min width:0.1}
					end tell
				end tell
				tell myBorderPanel2
					make static text with properties {static label:"      Cover Heigth:"}
					set myCH to make dialog column
					tell myCH
						set coverHeigth to make measurement editbox with properties {edit value:549, edit units:inches, small nudge:0.1, minimum value:1, maximum value:2000, min width:0.1}
					end tell
				end tell
				--
				set newBorderPanel to make border panel
				tell newBorderPanel
					make static text with properties {static label:"BC or BF:"}
					set myBCBF to make radiobutton group
					tell myBCBF
						set myBC to make radiobutton control with properties ¬
							{static label:"BC", checked state:true}
						set myBF to make radiobutton control with properties ¬
							{static label:"BF"}
						set myBFwL to make radiobutton control with properties ¬
							{static label:"BF w/SCH logo on FC"}
						set myEDU to make radiobutton control with properties ¬
							{static label:"EDU"}
					end tell
					make static text with properties {static label:"       Black text or K/O white text:"}
					set myKorW to make radiobutton group
					tell myKorW
						set myTextK to make radiobutton control with properties ¬
							{static label:"Black text", checked state:true}
						set myTextW to make radiobutton control with properties ¬
							{static label:"K/O white text"}
					end tell
				end tell
				----
				set newBorderPanel2 to make border panel
				tell newBorderPanel2
					make static text with properties {static label:"add white frame to Spine logo:"}
					set myWframeSP to make checkbox control with properties ¬
						{static label:"check for Yes", checked state:false}
				end tell
				set newBorderPanel3 to make border panel
				tell newBorderPanel3
					make static text with properties {static label:"add white frame to Front Cover logo:"}
					set myWframeFCP to make checkbox control with properties ¬
						{static label:"check for Yes", checked state:false}
				end tell
				set newBorderPanel3a to make border panel
				tell newBorderPanel3a
					make static text with properties {static label:"add white frame to Back Cover logo:"}
					set myWframeBCP to make checkbox control with properties ¬
						{static label:"check for Yes", checked state:false}
				end tell
				set newBorderPanel4 to make border panel
				tell newBorderPanel4
					make static text with properties {static label:"add cover credit to Back Cover:"}
					set myCC to make radiobutton group
					tell myCC
						set myCCN to make radiobutton control with properties ¬
							{static label:"No Cover Credit", checked state:true}
						set myCCLU to make radiobutton control with properties ¬
							{static label:"above lockup logo", checked state:false}
						set myCCBC to make radiobutton control with properties ¬
							{static label:"bottom center of back cover", checked state:false}
					end tell
				end tell
			end tell
			set theResult to show theDialog
			--show
			set spSize to (edit value of spineSize) / 72
			set myB to (edit value of bleedamount) / 72
			set myW to (edit value of coverWidth) / 72
			set myH to (edit value of coverHeigth) / 72
			--set MyP to (edit contents of BFPrice)
			set myBCorBF to selected button of myBCBF
			set myKW to selected button of myKorW
			set myWFSP to checked state of myWframeSP
			set myWFFC to checked state of myWframeFCP
			set myWFBC to checked state of myWframeBCP
			set myCCC to selected button of myCC
			destroy theDialog
		end tell
		
	end tell
end myDialog

on myContinue()
	tell application id "com.adobe.InDesign"
	
		set myDW to (myW + myW + spSize)
		set theDoc to make document with properties {document preferences:{name:"New_Build", page height:myH & " in" as string, page width:myDW & " in" as string, pages per document:1, facing pages:false, document bleed bottom offset:myB, document bleed inside or left offset:myB, document bleed top offset:myB, document bleed outside or right offset:myB, document bleed uniform size:true}} --& " in" as string
		tell pages of theDoc
			set properties of margin preferences to {column count:2, column gutter:spSize, top:0.25, bottom:0.25, left:0.25, right:0.25}
		end tell
		tell theDoc to set zero point to {0, 0}
		tell theDoc

			--box to show background for test only
			set theFrameTest to make rectangle with properties {geometric bounds:{-myB, -myB, myB + myH, myW + myW + myB + spSize}, label:"theFrameTest", fill color:"Cyan", fill tint:50, stroke weight:0, stroke color:"None", layer:"Branding"}

			set theLayer to "Quad Trim Marks"
			make layer with properties {name:theLayer, visible:true, locked:false, layer color:olive green}
			set blackColor to swatch "Registration"
			set NoColor to swatch "None"
			set theFramecolor to swatch "Paper"
			set oldTRP to transform reference point of layout window 1
			set transform reference point of layout window 1 to center anchor
			set tLm to {-myB, myW, -myB - 0.25, myW}
			set tRm to {-myB, myW + spSize, -myB - 0.25, myW + spSize}
			set bLm to {myH + myB, myW, myH + myB + 0.25, myW}
			set bRm to {myH + myB, myW + spSize, myH + myB + 0.25, myW + spSize}
			set sW to ".5" & " pt" as string
			make graphic line with properties {geometric bounds:tLm, stroke type:"Solid", stroke weight:sW, stroke color:blackColor, stroke alignment:center alignment, layer:theLayer}
			make graphic line with properties {geometric bounds:tRm, stroke type:"Solid", stroke weight:sW, stroke color:blackColor, stroke alignment:center alignment, layer:theLayer}
			make graphic line with properties {geometric bounds:bLm, stroke type:"Solid", stroke weight:sW, stroke color:blackColor, stroke alignment:center alignment, layer:theLayer}
			make graphic line with properties {geometric bounds:bRm, stroke type:"Solid", stroke weight:sW, stroke color:blackColor, stroke alignment:center alignment, layer:theLayer}
			set transform reference point of layout window 1 to oldTRP
			----------
			tell theDoc
				make guide with properties {location:(myW / 2), orientation:vertical}
				make guide with properties {location:(myW + spSize + 0.25), orientation:vertical}
				make guide with properties {location:(myW - 0.25), orientation:vertical}
				make guide with properties {location:(myW + spSize + (myW / 2)), orientation:vertical}
			end tell
			set theUnusedSwatches to unused swatches
			repeat with UnusedSwatch from 1 to count of theUnusedSwatches
				if name of (item UnusedSwatch of theUnusedSwatches) is not "" then
					try
						delete (item UnusedSwatch of theUnusedSwatches)
					end try
				end if
			end repeat
			
		end tell
	end tell
end myContinue

on myplaceitems()
	tell application id "com.adobe.InDesign"

		--For BC placements
		tell theDoc
			set theLayer to "Branding" as string
			if exists layer theLayer then
				set theLayer to theLayer
			else
				set theLayer to make layer with properties {name:"Branding", visible:true, locked:false, layer color:red}
			end if
		end tell
		set transform reference point of layout window 1 to top left anchor
		--BC or BF barcode
		if myBCorBF = 0 then
			set asset1place to place asset asset "BC_EAN Box" of library "SCH Library.indl" on theDoc
			move asset1place to {myW - 1.75, myH - 1.01}
		else if myBCorBF = 1 then
			set asset1place to place asset asset "BF_EAN Box" of library "SCH Library.indl" on theDoc
			move asset1place to {myW - 2.4931, myH - 1.0725}
		else if myBCorBF = 2 then
			set asset1place to place asset asset "BF_EAN Box" of library "SCH Library.indl" on theDoc
			move asset1place to {myW - 2.4931, myH - 1.0725}
		else
			set asset1place to place asset asset "EDU_Barcode Box" of library "SCH Library.indl" on theDoc
			move asset1place to {myW - 2.07, myH - 1.3778} --(-1.82, -1.1278)
		end if
		
		--Black or White text
		if myBCorBF = 3 then
			if myKW = 0 then
				set asset2place to place asset asset "EDU_lockup Black" of library "SCH Library.indl" on theDoc
				move asset2place to {0.25, myH - 1.0458}
			else
				set asset2place to place asset asset "EDU_lockup White" of library "SCH Library.indl" on theDoc
				move asset2place to {0.25, myH - 1.0458}
			end if
			--place small, medium, large lockup
		else
			if myKW = 0 then
				if myW ≥ 6 and myW < 9 then
					set asset2place to place asset asset "RedBar.WWW.lockup.black_med" of library "SCH Library.indl" on theDoc
					move asset2place to {0.25, myH - 1.2075} -- (+.0239)
				else if myW ≥ 9 then
					set asset2place to place asset asset "RedBar.WWW.lockup.black_lrg" of library "SCH Library.indl" on theDoc
					move asset2place to {0.25, myH - 1.35}
				else
					set asset2place to place asset asset "RedBar.WWW.lockup.black_sm" of library "SCH Library.indl" on theDoc
					move asset2place to {0.25, myH - 1.1355}
				end if
			else
				if myW ≥ 6 and myW < 9 then
					set asset2place to place asset asset "RedBar.WWW.lockup.white_med" of library "SCH Library.indl" on theDoc
					move asset2place to {0.25, myH - 1.2075}
				else if myW ≥ 9 then
					set asset2place to place asset asset "RedBar.WWW.lockup.white_lrg" of library "SCH Library.indl" on theDoc
					move asset2place to {0.25, myH - 1.35}
				else
					set asset2place to place asset asset "RedBar.WWW.lockup.white_sm" of library "SCH Library.indl" on theDoc
					move asset2place to {0.25, myH - 1.1355}
				end if
			end if
		end if
	
		--place spine logo
		if spSize > 0.01 and spSize < 0.25 then
			set asset3place to place asset asset "ScholasticMinibarBig" of library "SCH Library.indl" on theDoc
			move asset3place to {myW + ((spSize - 0.25) / 2), (myH - 0.25 - 0.5496)}
			
			tell theDoc
				set transform reference point of layout window 1 to bottom center anchor
				copy (geometric bounds of page item 1 whose label is "ScholasticMinibarBig") to {y0, x0, y1, x1}
				set theScale to (spSize / (x1 - x0) * 100)
				set horizontal scale of page item 1 whose label is "ScholasticMinibarBig" to theScale
				set vertical scale of page item 1 whose label is "ScholasticMinibarBig" to theScale
				move asset3place to {myW, (myH - 0.25 + ((y0 - y1) * (theScale / 100)))}
			end tell
			
			--add stroke for white frame
			if myWFSP = true then
				tell theDoc
					set transform reference point of layout window 1 to center anchor
					copy (geometric bounds of page item 1 whose label is "ScholasticMinibarBig") to {y0, x0, y1, x1}
					set x0 to (x0 + 0.0035)
					set x1 to (x1 - 0.0035)
					set y0 to (y0 + 0.0035)
					set y1 to (y1 - 0.0035)
					set (geometric bounds of page item 1 whose label is "ScholasticMinibarBig") to {y0, x0, y1, x1}
					set properties of page item 1 whose label is "ScholasticMinibarBig" to {stroke color:theFramecolor, stroke weight:0.5, stroke alignment:center alignment}
				end tell
			end if
			
		else if spSize ≥ 0.25 and spSize < 0.75 then
			set asset3place to place asset asset "ScholasticMinibarBig" of library "SCH Library.indl" on theDoc
			move asset3place to {myW + ((spSize - 0.25) / 2), (myH - 0.25 - 0.5496)}
			--add stroke for white frame
			if myWFSP = true then
				tell theDoc
					copy (geometric bounds of page item 1 whose label is "ScholasticMinibarBig") to {y0, x0, y1, x1}
					set x0 to (x0 + 0.0035)
					set x1 to (x1 - 0.0035)
					set y0 to (y0 + 0.0035)
					set y1 to (y1 - 0.0035)
					set (geometric bounds of page item 1 whose label is "ScholasticMinibarBig") to {y0, x0, y1, x1}
					set properties of page item 1 whose label is "ScholasticMinibarBig" to {stroke color:theFramecolor, stroke weight:0.5, stroke alignment:center alignment}
				end tell
			end if
			
		else if spSize ≥ 0.75 then
			set asset3place to place asset asset "ScholasticMinibarBig" of library "SCH Library.indl" on theDoc
			set transform reference point of layout window 1 to bottom left anchor
			move asset3place to {myW, (myH - 0.25 - 0.5496)}
			tell theDoc
				set transform reference point of layout window 1 to bottom left anchor
				copy (geometric bounds of page item 1 whose label is "ScholasticMinibarBig") to {y0, x0, y1, x1}
				set theScale to (0.35 / (x1 - x0) * 100)
				set horizontal scale of page item 1 whose label is "ScholasticMinibarBig" to theScale
				set vertical scale of page item 1 whose label is "ScholasticMinibarBig" to theScale
				move asset3place to {myW + (spSize / 2) - 0.175, (myH - 0.25 + ((y0 - y1) * (theScale / 100)))}
			end tell
			
			--add stroke for white frame
			if myWFSP = true then
				tell theDoc
					copy (geometric bounds of page item 1 whose label is "ScholasticMinibarBig") to {y0, x0, y1, x1}
					set x0 to (x0 + 0.0035)
					set x1 to (x1 - 0.0035)
					set y0 to (y0 + 0.0035)
					set y1 to (y1 - 0.0035)
					set (geometric bounds of page item 1 whose label is "ScholasticMinibarBig") to {y0, x0, y1, x1}
					set properties of page item 1 whose label is "ScholasticMinibarBig" to {stroke color:theFramecolor, stroke weight:0.5, stroke alignment:center alignment}
				end tell
			end if
		end if
		
		set theScale to 0

		--place SCHOLASTIC red bar logo
		if myBCorBF = 1 then
			
		else
			set asset4place to place asset asset "Schol_RED_BAR_m100y90" of library "SCH Library.indl" on theDoc
			set transform reference point of layout window 1 to bottom center anchor
			set transform reference point of layout window 1 to bottom center anchor
			move asset4place to {myW + spSize + (myW / 3), (myH - 0.25)}
			tell theDoc
				copy (geometric bounds of page item 1 whose label is "Schol_RED_BAR_m100y90") to {y0, x0, y1, x1}
				set theScale to ((myW / 3) / (x1 - x0) * 100)
				if theScale > 171.428571428571 then
					set theScale to 171.428571428571
				end if
				set horizontal scale of page item 1 whose label is "Schol_RED_BAR_m100y90" to theScale
				set vertical scale of page item 1 whose label is "Schol_RED_BAR_m100y90" to theScale
				if myW ≤ 9 then
					move asset4place to {myW + spSize + (myW / 3), (myH - 0.25 + ((y0 - y1) * (theScale / 100)))}
				else
					move asset4place to {myW + spSize + ((myW - 3) / 2), (myH - 0.25 + ((y0 - y1) * (theScale / 100)))}
				end if
			end tell
			--add stroke for white frame
			if myWFFC = true then
				tell theDoc
					copy (geometric bounds of page item 1 whose label is "Schol_RED_BAR_m100y90") to {y0, x0, y1, x1}
					set x0 to (x0 + 0.0035)
					set x1 to (x1 - 0.0035)
					set y0 to (y0 + 0.0035)
					set y1 to (y1 - 0.0035)
					set (geometric bounds of page item 1 whose label is "Schol_RED_BAR_m100y90") to {y0, x0, y1, x1}
					set properties of page item 1 whose label is "Schol_RED_BAR_m100y90" to {stroke color:theFramecolor, stroke weight:0.5, stroke alignment:center alignment}
				end tell
			end if
		end if
		--add center cover credit to BC
		if myCCC ≠ 1 then
			tell theDoc
				set theLockups to {"RedBar.WWW.lockup.black_sm", "RedBar.WWW.lockup.black_med", "RedBar.WWW.lockup.black_lrg", "RedBar.WWW.lockup.white_sm", "RedBar.WWW.lockup.white_med", "RedBar.WWW.lockup.white_lrg", "EDU_lockup Black", "EDU_lockup White"}
				repeat with k from 1 to count of theLockups
					try
						set theItem to item k of theLockups
						set theSel to (every page item whose label is theItem)
						repeat with j from (count of theSel) to 1 by -1
							select item j of theSel
							ungroup item j of theSel
							set theList to (every text frame whose label is "CoverCreditLU")
							repeat with i from (count of theList) to 1 by -1
								select item i of theList
								delete selection
							end repeat
						end repeat
					end try
				end repeat
			end tell
		end if
		if myCCC = 2 and myBCorBF ≠ 1 then
			--set transform reference point of layout window 1 to bottom center anchor
			if myKW = 0 then
				set asset5place to place asset asset "CenterCoverCredit" of library "SCH Library.indl" on theDoc
				tell theDoc
					copy (geometric bounds of page item 1 whose label is "CenterCoverCredit") to {y0, x0, y1, x1}
					if myBCorBF = 2 then
						set (geometric bounds of page item 1 whose label is "CenterCoverCredit") to {(myH - 0.25 - 0.1982), 2, (myH - 0.25), (myW - 2.07)}
					else if myW ≥ 9 then
						set (geometric bounds of page item 1 whose label is "CenterCoverCredit") to {(myH - 0.25 - 0.1982), 2, (myH - 0.25), (myW - 1.75)}
					else if myW ≥ 6 and myW < 9 then
						set (geometric bounds of page item 1 whose label is "CenterCoverCredit") to {(myH - 0.25 - 0.1982), 1.75, (myH - 0.25), (myW - 1.75)}
					else
						set (geometric bounds of page item 1 whose label is "CenterCoverCredit") to {(myH - 0.25 - 0.1982), 1.625, (myH - 0.25), (myW - 1.75)}
						tell (parent story of page item 1 whose label is "CenterCoverCredit")
							set point size to 6
						end tell
					end if
				end tell
			else
				set asset5place to place asset asset "CenterCoverCreditW" of library "SCH Library.indl" on theDoc
				tell theDoc
					copy (geometric bounds of page item 1 whose label is "CenterCoverCreditW") to {y0, x0, y1, x1}
					if myBCorBF = 2 then
						set (geometric bounds of page item 1 whose label is "CenterCoverCreditW") to {(myH - 0.25 - 0.1982), 2, (myH - 0.25), (myW - 2.07)}
					else if myW ≥ 9 then
						set (geometric bounds of page item 1 whose label is "CenterCoverCreditW") to {(myH - 0.25 - 0.1982), 2, (myH - 0.25), (myW - 1.75)}
					else if myW ≥ 6 and myW < 9 then
						set (geometric bounds of page item 1 whose label is "CenterCoverCreditW") to {(myH - 0.25 - 0.1982), 1.75, (myH - 0.25), (myW - 1.75)}
					else
						set (geometric bounds of page item 1 whose label is "CenterCoverCreditW") to {(myH - 0.25 - 0.1982), 1.625, (myH - 0.25), (myW - 1.75)}
						tell (parent story of page item 1 whose label is "CenterCoverCreditW")
							set point size to 6
						end tell
					end if
				end tell
			end if
		end if
		if myCCC = 2 and myBCorBF = 1 then
			--set transform reference point of layout window 1 to bottom center anchor
			if myKW = 0 then
				set asset5place to place asset asset "CenterCoverCredit" of library "SCH Library.indl" on theDoc
				tell theDoc
					copy (geometric bounds of page item 1 whose label is "CenterCoverCredit") to {y0, x0, y1, x1}
					--set (geometric bounds of page item 1 whose label is "CenterCoverCredit") to {(myH - 0.25 - 0.1982), 2, (myH - 0.25), (myW - 2.493)}
					if myW ≥ 9 then
						set (geometric bounds of page item 1 whose label is "CenterCoverCredit") to {(myH - 0.25 - 0.1982), 2, (myH - 0.25), (myW - 2.493)}
					else if myW ≥ 6 and myW < 9 then
						set (geometric bounds of page item 1 whose label is "CenterCoverCredit") to {(myH - 0.25 - 0.1982), 1.75, (myH - 0.25), (myW - 2.493)}
					else
						set (geometric bounds of page item 1 whose label is "CenterCoverCredit") to {(myH - 0.25 - 0.1982), 1.625, (myH - 0.25), (myW - 2.493)}
						tell (parent story of page item 1 whose label is "CenterCoverCredit")
							set point size to 6
						end tell
					end if
				end tell
			else
				set asset5place to place asset asset "CenterCoverCreditW" of library "SCH Library.indl" on theDoc
				tell theDoc
					copy (geometric bounds of page item 1 whose label is "CenterCoverCreditW") to {y0, x0, y1, x1}
					--set (geometric bounds of page item 1 whose label is "CenterCoverCreditW") to {(myH - 0.25 - 0.1982), 2, (myH - 0.25), (myW - 2.493)}
					if myW ≥ 9 then
						set (geometric bounds of page item 1 whose label is "CenterCoverCreditW") to {(myH - 0.25 - 0.1982), 2, (myH - 0.25), (myW - 2.493)}
					else if myW ≥ 6 and myW < 9 then
						set (geometric bounds of page item 1 whose label is "CenterCoverCreditW") to {(myH - 0.25 - 0.1982), 1.75, (myH - 0.25), (myW - 2.493)}
					else
						set (geometric bounds of page item 1 whose label is "CenterCoverCreditW") to {(myH - 0.25 - 0.1982), 1.625, (myH - 0.25), (myW - 2.493)}
						tell (parent story of page item 1 whose label is "CenterCoverCreditW")
							set point size to 6
						end tell
					end if
				end tell
			end if
		end if
		
		-------
		tell theDoc
			set theLayers to name of layers of theDoc
			repeat with j from 1 to count of theLayers
				set theLayer to item j of theLayers
				if theLayer is not "Quad Trim Marks" then
					if theLayer is not "New Items" then
						if theLayer = "Layer 1" then
							--set properties of layer "Layer 1" to {name:"Base Layer"}
							--else
							set theMerge to item j of theLayers
							merge layer "Branding" with layer theMerge
						end if
					end if
				end if
			end repeat
		end tell
		tell view preferences --of application
			set ruler origin to theoldorig
		end tell
	end tell
end myplaceitems
--{thebarcode, thejob2, thejob3}
--{thenewpath, thisLink}

Please help…

Model: Mac Pro
AppleScript: Script Editor Version 2.11
Browser: Safari 537.36
Operating System: macOS 10.14

That is perfect Fredrik, Thank you

Any point in the right direction is a seriously huge and greatly appreciated help.

I will do this and let you know what i find.