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

Keystrokes to InDesign via script

Explorer ,
Oct 31, 2013 Oct 31, 2013

Copy link to clipboard

Copied

Is it possible to send keystrokes to InDesign in a JavaScript script? I want to invoke a menu option and then send the keystrokes for subsequent dialog boxes to automate the execution of the menu option. How can I do this?

Thanks!

TOPICS
Scripting

Views

924

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
Advocate ,
Oct 31, 2013 Oct 31, 2013

Copy link to clipboard

Copied

Hi Dan-BTP,

I think it's possible in Apple Script, to Execute the Export Kindle and Save As Dialog enter "OK" button. You can try the Apple script Key Stroke methods.

thx,

csm_phil

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
Explorer ,
Nov 01, 2013 Nov 01, 2013

Copy link to clipboard

Copied

Thanks for the suggestion! I'll look into it.

Dan

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
Community Beginner ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

Hi if want use windows, what would be the solutions

 

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
Explorer ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

Autohotkey

And send commands

@dtptutorialycz

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
Community Expert ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

What exactly are you trying to achieve? 

 

Almost everything that you can set manually - every option in Dialog Boxes - is available directly through scripting. 

 

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
Community Beginner ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

I'm actually looking for the data merge option. For example, open a specific InDesign file, go to Data Merge, select 'Update Data Source,' and then 'Export as PDF'.

I'm familiar with VBA and Java Script only

 

In the 'Data source' and 'split PDF by page range', I have created a VBA

 

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
Community Expert ,
Nov 30, 2023 Nov 30, 2023

Copy link to clipboard

Copied

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
Community Beginner ,
Nov 30, 2023 Nov 30, 2023

Copy link to clipboard

Copied

Need help this code

// Adobe InDesign CC/2020 script that exports all open documents as PDFs using text data from the latest added text frame as the file name.
// Made by Anton "Wyrax" Som, Kyiv, Ukraine, 2020

if (app.documents.length === 0) {
    alert('Open documents first.');
} else {
    var documentsNumber = app.documents.length;
    var myPDFExportPreset = app.pdfExportPresets.item("[Press Quality]"); // Change this to the actual PDF-preset name if error message: Invalid value for parameter 'using' of method 'exportFile'. Expected PDFExportPreset, but received nothing.
    
    var myDocument = app.activeDocument;
    var myDataMerge = myDocument.dataMergeProperties;

    myDataMerge.updateDataSource();
    myDocument.dataMergeProperties.mergeRecords();

    //var outputFolder = new Folder('D:/PDFbasket/');

   /*if (!outputFolder.exists) {
        outputFolder.create();
    }*/

    for (var i = 0; i < documentsNumber; i++) {
        var textFrame = myDocument.textFrames[0];

        if (textFrame) {
            var fileName = textFrame.contents; // Get text frame content
            textFrame.remove();
            
            var outputFile = "C:\Users\Yaser\Desktop\Dummy.pdf"
            //var outputFile = new File(outputFolder + "/" + fileName + ".pdf");
            myDocument.exportFile(outputFile, myPDFExportPreset);
            myDocument.close(SaveOptions.no);
        } else {
            alert('No text frame found in the document.');
        }
    }

    alert("Exported into " + outputFolder.fsName);
}

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
Community Expert ,
Dec 01, 2023 Dec 01, 2023

Copy link to clipboard

Copied

LATEST

This code doesn't make much sense... 

 

What kind of help? 

 

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