Skip to main content
Aprking
Inspiring
June 28, 2023
Answered

How to retrieve the default [Basic] value of the preflight profile configuration file in INDESIGN?

  • June 28, 2023
  • 1 reply
  • 665 views

When scripting the batch export of PDF files in INDESIGN, I encountered an issue with retrieving the preflight profile configuration. The problem lies in the fact that the default first value is "[Basic]," which would cause an error if passed to the following code:

var preflightProfile = app.preflightProfiles.item(preflightName);

since "[Basic]" is not a valid value. However, all other options from the dropdown menu work correctly. What is the correct value for [Basic]?

 

 

This topic has been closed for replies.
Correct answer Aprking

The .item() method’s parameter can be either an index number or string—.itemByName only takes a string.

 

"[Basic]" doesn’t work in either case, not sure why? Might be a bug.

 

 

 


var preflightName = preflightDropdown.selection.text;
if (preflightName === "[Basic]") {
preflightName = 0;
}
The test has been passed. Thank you for @rob day assistance!

1 reply

rob day
Community Expert
Community Expert
June 28, 2023

What is the correct value for [Basic]?

 

Hi @Aprking , This is what I get—not sure why itemByName returns not valid:

 

 

 

$.writeln(app.preflightProfiles[0].name)
//returns [Basic]

var bpf = app.preflightProfiles.item(0)
$.writeln(bpf.isValid + " " + bpf.name)
//returns true [Basic]

var bpf = app.preflightProfiles.firstItem()
$.writeln(bpf.isValid + " " + bpf.name)
//returns true [Basic]

var bpf = app.preflightProfiles.itemByName("[Basic]")
$.writeln(bpf.isValid )
//returns false

 

 

 

Aprking
AprkingAuthor
Inspiring
June 28, 2023

Hello, Rob Day! Nice to see you again today. According to what should be, [Basic] is the first option, so it should be var bpf = app.preflightProfiles.item(0), but when I try to get the [Basic] from the dropdown menu in INDESIGN, it throws an error, which confuses me. I even tried "Basic""[Basic]""basic", but none of them worked.