Copy link to clipboard
Copied
Hi~
Do you want to know JavaScript that goes to the last page when I open a document in In Design? Help me~
Copy link to clipboard
Copied
Hi,
Do you mean actually move what the user sees on the screen to tha last page? OR
get the last page in your script so you can do something with it?
Malcolm
Copy link to clipboard
Copied
I'd like to create a new page on the last page of the document and create multiple text frames with a repeating statement.
Copy link to clipboard
Copied
This makes the last page active:
var pc = app.activeDocument.pages.length;
var lp = app.activeDocument.pages[pc-1];
app.activeWindow.activePage=lp;
Copy link to clipboard
Copied
I'd like to create a new page on the last page of the document and create multiple text frames with a repeating statement.
What should I do?
var pc = app.activeDocument.pages.length;
var lp = app.activeDocument.pages[pc-1];
app.activeWindow.activePage=lp;
Copy link to clipboard
Copied
hi, this example is especially for you:
function main(){
var rules_align = Number(app.activeDocument.viewPreferences.rulerOrigin)
app.activeDocument.viewPreferences.rulerOrigin = 1380143215
app.activeDocument.pages.add(LocationOptions.AT_END)
for(var i = 0; i < 3; i++){
var mytextframe = app.activeDocument.pages.item(-1).textFrames.add()
mytextframe.geometricBounds = [0+i*5,0,5+i*5,25]
mytextframe.contents = 'hello world !'
}
app.activeDocument.viewPreferences.rulerOrigin = rules_align
}
app.doScript('main()', ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, 'hello world !')