Open multiple documents

I am trying to import multiple documents into InDesign. I want to do with with a repeat, because I am not sure how many files or their name. In just testing I can use this script to get a file of the folder.

tell application "Finder"
	set myfolder to folder "Macintosh HD:Users:user:Desktop:xml:"
	set filePath to file 1 of myfolder
end tell

The problem is when I get the return it is in a format that InDesign can’t use.

Now I saw that if I use the “a reference to” I would get the colon path. Like this:

tell application "Finder"
	set myfolder to folder "Macintosh HD:Users:elliott:Desktop:xml:"
	set filePath to a reference to file 1 of myfolder
end tell

But I end up with this:

Long story short I am not sure how to loop through a folder importing the files in there

Check the ID dictionary to see what class it wants the path to be in. “As string” and “As alias” usually work.

The dictionary say it can take either a string or an alias.

I found out how to make it work by using copy as a string

Thanks for the help.