Highlighted

Creating folder name same as document name

Community Beginner ,
Jun 16, 2020

Copy link to clipboard

Copied

I have attached the code to save the document and my query is I have to create an folder same as the saved InDesign Document name. Please guide me.

 

Utils<IDocumentUtils>()->DoSave(document);

UIDRef docUIDRef = ::GetUIDRef(document);
SDKLayoutHelper layoutHelper;

SDKFileSaveChooser fileSaveChooser;
fileSaveChooser.AddFilter(kInDesignFileTypeInfoID,
PMString("INDD files(Indd)").SetTranslatable(kFalse));
fileSaveChooser.SetTitle("Save INDD Document");
if (!fileSaveChooser.IsChosen()) { }
PMString filepath;
IDFile choosenFile;
if (fileSaveChooser.IsChosen()) {
choosenFile = fileSaveChooser.GetIDFile();

FileUtils::IDFileToPMString(choosenFile, filepath);

}
FileUtils::CreateFolderIfNeeded(choosenFile, kFalse);
layoutHelper.SaveDocumentAs(::GetUIDRef(document), choosenFile);

 

Rajendran
TOPICS
How to, SDK

Views

49

Likes

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

Creating folder name same as document name

Community Beginner ,
Jun 16, 2020

Copy link to clipboard

Copied

I have attached the code to save the document and my query is I have to create an folder same as the saved InDesign Document name. Please guide me.

 

Utils<IDocumentUtils>()->DoSave(document);

UIDRef docUIDRef = ::GetUIDRef(document);
SDKLayoutHelper layoutHelper;

SDKFileSaveChooser fileSaveChooser;
fileSaveChooser.AddFilter(kInDesignFileTypeInfoID,
PMString("INDD files(Indd)").SetTranslatable(kFalse));
fileSaveChooser.SetTitle("Save INDD Document");
if (!fileSaveChooser.IsChosen()) { }
PMString filepath;
IDFile choosenFile;
if (fileSaveChooser.IsChosen()) {
choosenFile = fileSaveChooser.GetIDFile();

FileUtils::IDFileToPMString(choosenFile, filepath);

}
FileUtils::CreateFolderIfNeeded(choosenFile, kFalse);
layoutHelper.SaveDocumentAs(::GetUIDRef(document), choosenFile);

 

Rajendran
TOPICS
How to, SDK

Views

50

Likes

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
Jun 16, 2020 0

Have something to add?

Join the conversation