• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Apple script to Javascript

New Here ,
Mar 16, 2017 Mar 16, 2017

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

TOPICS
Scripting

Views

380

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
community guidelines
Guru ,
Mar 17, 2017 Mar 17, 2017

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

Votes

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
community guidelines
New Here ,
Mar 20, 2017 Mar 20, 2017

Copy link to clipboard

Copied

LATEST

Thank You! Works great!

Votes

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
community guidelines