如何在不扩展传播的情况下移动带有javascript的页面?



我是Indesign的javascript新手,我有这个问题。 我使用此代码,每次我想用脚本移动的页面都在移动,但发生了错误。我得到了一个跨页扩展 - 在新的页面顺序中,这两个页面成为跨页扩展 - 我移动的页面加上页面之后成为多页跨页(也称为孤岛跨页(。我不想这样,我希望我用脚本移动的页面是单一的,没有对页,没有扩展。 谢谢!

app.scriptPreferences.measurementUnit = MeasurementUnits.POINTS;
// app.generalPreferences.pageNumbering = PageNumberingOptions.absolute;
app.scriptPreferences.enableRedraw = false;
app.layoutWindows[0].transformReferencePoint = AnchorPoint.CENTER_ANCHOR;
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
var myDocument = app.documents[0];
var myPage_length = app.documents[0].pages.length
var myPages = app.documents[0].pages
var pages = app.activeDocument.pages;

var spread = app.activeDocument.spreads.everyItem()
preserveLayoutWhenShuffling = true;
myDocument.documentPreferences.allowPageShuffle = true;
spread.allowPageShuffle = true;
// myDocument.documentPreferences.allowSpreadShuffle = true;
myDocument.documentPreferences.facingPages = false;
myDocument.documentPreferences.preserveLayoutWhenShuffling = true;
/// some code
var myCounter = 0
var myAntiCounter = 1
myPages[myCounter].move(LocationOptions.AFTER, app.activeDocument.pages[myAntiCounter]);

我找到了诀窍! 如果移动命令使用页面移动效果将是文档末尾将以多页传播,我不希望这样 解决方案是移动跨页而不是页面 喜欢这个:

app.documents[0].spreads.item(myCounter).move(LocationOptions.AFTER, app.documents[0].spreads.item(myCounter + 1));

颐:)

最新更新