• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Script with an Indesign book

New Here ,
Oct 10, 2018 Oct 10, 2018

Copy link to clipboard

Copied

Hello,

Is it possible with a script to delete the files of an indesign book and to add all the files present in the same folder as the book.

Regards

Claire T

TOPICS
Scripting

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Oct 10, 2018 Oct 10, 2018

Copy link to clipboard

Copied

It is possible, but sounds kind of risky.

When you say delete, do you mean actually to delete the files off the harddrive, or just remove them from the book file?

Ariel

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 10, 2018 Oct 10, 2018

Copy link to clipboard

Copied

just remove the files from the book file

Claire TANGUY

Mail : ctanguy@galilee.fr

Skype : Formgal

Le 10/10/2018 à 12:56, Tá´€W a écrit :

Script with  an Indesign book

created by Tá´€W <https://forums.adobe.com/people/T%E1%B4%80W> in

/InDesign Scripting/ - View the full discussion

<https://forums.adobe.com/message/10669420#10669420>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 10, 2018 Oct 10, 2018

Copy link to clipboard

Copied

Hi Formgali,

Check below link:

Re: How to remove all the contents of a book in scripting

Thanks,

Prabu G

Thanks,
Prabu
Design smarter, faster, and bolder with InDesign scripting.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 11, 2018 Dec 11, 2018

Copy link to clipboard

Copied

LATEST

This script removes the files from a book and adds .indd files to the book that are stored at the same location as the book file

book = app.activeBook;

//if more than one book is open ask user if the script is targeting the correct book

if (app.books.length > 1)

    {

        var x = confirm("Remove all Docs from the book\n" + book.name + "?");

    }

//exit script if users clicks "no"

if (x == false) {exit();}

//remove existing bookContents

if (book.bookContents.length > 0)

    {

        book.automaticPagination = false;

        book.bookContents.everyItem().remove();

    }

//get indd files from the location where the book file is stored

folder = Folder(File(book.filePath).fullName);

bContents = folder.getFiles("*.indd");

//add files to the book

for (var i = 0; i < bContents.length; i++)

    {

        book.bookContents.add(bContents);

    }

book.automaticPagination = true;

alert("Done");

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines