# Cannot access bookContent properties

**URL:** <https://forums.creativeclouddeveloper.com/t/cannot-access-bookcontent-properties/8517>\
**Category:** InDesign\
**Tags:** uxp, javascript\
**Created:** [October 14, 2024, 8:04pm UTC](https://forums.creativeclouddeveloper.com/t/cannot-access-bookcontent-properties/8517 "2024-10-14T20:04:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![epicart](https://avatars.discourse-cdn.com/v4/letter/e/a88e57/32.png) [@epicart](https://forums.creativeclouddeveloper.com/u/epicart)\
**Post date:** [October 14, 2024, 8:04pm UTC](https://forums.creativeclouddeveloper.com/t/cannot-access-bookcontent-properties/8517/1 "2024-10-14T20:04:42Z")

</div>

i’m migrating an old Indesign script i created to process book documents before starting to work on them.  
i’m trying to get a list of all documents in the book and open each one, process and save it.  
i created a UXP plugin, but when i’m trying to access the bookContent properties like the filePath i’m getting back rejected promisses and not valid objects  
i already tried adding full file system permissions with no luck.  
i tried

```auto
await book.bookContents.firstItem().filePath

```

but i’m getting back some kind of Symbol()  
without await i get a resolved Promise which the result is an “n”…

---

<div class="post-metadata">

**Author:** ![MikeGames](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/mikegames/32/4446_2.png) [@MikeGames](https://forums.creativeclouddeveloper.com/u/MikeGames)\
**Post date:** [March 21, 2025, 8:30pm UTC](https://forums.creativeclouddeveloper.com/t/cannot-access-bookcontent-properties/8517/2 "2025-03-21T20:30:39Z")

</div>

I see this is older, but I have the same issue. Not sure if you ever worked it out.

this line is the issue:

// Open the .indd file  
const filePath = bookContent.filePath;

I see it’s a promise, but it’s not resolving, and so I’ve tried to resolve it, and this is what I found.

Promise Error: Error: Could not find an entry of ‘file:///Users/mlynch/Library/CloudStorage/GoogleDrive-me@here.com/.shortcut-targets-by-id/1IM2FTLoqXdBU1IuQ%20Adoption%20Source%20Files/\_SP\_20’

And that is not helping me much.

---

<div class="post-metadata">

**Author:** ![Vnh68](https://avatars.discourse-cdn.com/v4/letter/v/6f9a4e/32.png) [@Vnh68](https://forums.creativeclouddeveloper.com/u/Vnh68)\
**Post date:** [July 19, 2025, 11:02am UTC](https://forums.creativeclouddeveloper.com/t/cannot-access-bookcontent-properties/8517/3 "2025-07-19T11:02:36Z")

</div>

Hello Mike!  
I’ll be brief, maybe you’ve already found a solution.

```auto
const bookDocuments = async (book) => {
let allPromisedFullNames = book.bookContents
	.everyItem().getElements()
	.map(e => e.fullName); // Array of Promises here
	
	/*
	let allPromisedFullNames = book.bookContents.everyItem().fullName; //This returns not an Array, but collection. Be careful! 
	*/
	
	let fullNames = await Promise.all(allPromisedFullNames); // Now we have the Array of Files (not opened)
	return fullNames;
};

/////// call function to handle every document in the book
let files = await bookDocuments(app.books.item(0)); //select a book by item, by name...
files.forEach(indd => {
	let adoc = app.open(indd);
	//... handle ...
	adoc.close(SaveOptions.YES); //or without saving, if you want
});

```
