Copy link to clipboard
Copied
Hello,
I'm new to javascript but have managed to put together a simple preflight script that works for my needs. I would like to add one more step to the script that would allow you to change the page numbers in the pages panel. I found a apple script that will do this, but I'm having trouble converting it to Javascript. Any help would be greatly appreciated. I would be happy to share the preflight script if anyone is interested as well!
Thanks
set mypagenumber to text returned of (display dialog "set pagenumber" with title "set the pagenumber" with icon 1 default answer "1" buttons {"set"} default button 1)
tell application "Adobe InDesign CC 2015"
tell document 1
tell document preferences
set start page number to (mypagenumber as integer)
end tell
end tell
end tell
Copy link to clipboard
Copied
Something like this:
Main();
function Main() {
var pageName = prompt("Type in a page number", "1", "Set the page number");
var pageNumber = parseInt(pageName);
if (pageName != null && app.documents.length > 0 && !isNaN(pageNumber)) {
var doc = app.activeDocument;
doc.documentPreferences.startPageNumber = pageNumber;
}
}
Hope it helps.
— Kas
Copy link to clipboard
Copied
Thank You! Works great!