Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all 15932 articles
Browse latest View live

Place multiple PDF files (or a folder of PDF files) into one InDesign document

$
0
0


Hi,

 

I know there are several scripts to place multipage Pdf's in InDesign.

Based on those scripts I made one myself which places a PDF file with multiple pages as an InLine graphic where the name of the PDF file is inserted as a heading.

Works great. But when I want to import 20 PDF files I have to run that script 20 times which isn't handy.

So I'm looking for a way to choose a folder in which are several PDF-files that will be placed inside 1 ID doc.

 

Any suggestions?


SortParagraphs Rules Do Not Follow Standards

$
0
0

SortParagraphs seems to use different sets of rules in determining the sorting order of hyphenated words and quotes. I sorted the following in InDesign’s SortParagraphs.applescript and compared the result with Excel and BBEdit. The latter two are the same.

 

InDesign Result:

 

Bacon-Feta Chicken   Rolls
Bacon Mushroom Chicken
Cheddar Chicken Spaghetti
Chicken-Pesto Pan Pizza
Chicken and Barley Boiled Dinner
Chicken ‘n’ Chilies Casserole

 

Excel, BBEdit Results:

 

 

Bacon Mushroom   Chicken
Bacon-Feta Chicken Rolls
Cheddar Chicken Spaghetti
Chicken ‘n’ Chilies Casserole
Chicken and Barley Boiled Dinner
Chicken-Pesto Pan Pizza

 

I read the guidelines in www.niso.org/publications/tr/tr03.pdf and it appears to me that Excel and BBEdit follow the rules stated in the guidelines.

 

Any comments or suggestion to make InDesign to sort the way Excel and BBEdit do?

Indesign Layers & Alternate Layout to Photoshop layered stack script

$
0
0

Hi all,

 

I am using the Indesign Layers to Photoshop applescript for part of a workflow I am using.

 

http://www.zenodesign.com/forum/PageToPSLayersV6.zip

 

 


the script let's you select a page to export to photoshop where it reproduces the layered indesign page in Photoshop.

 

I need to somehow edit the script where the user can select a range or ALL pages (this is to export out and create a stack in Photoshop).

 

If possible - the use can select a Alternate Layout' (this will be 3-4 pages) and export that out as a stack in Photoshop or stack of layers in a group. the group being the page.

 

Hoepfully that makes sense.

 

I would appreciate any help/ feedback/ideas

 

Thanks all.

 

H.

I have touble with 'mapStylesToXMLTags()' it freezes my InDesign... any idea? THANK YOU

Please provide the Story Splitter script by Adi Ravid?

$
0
0

Hi,

 

I'm working on a complex book and need to split threaded stories at lots of places. I know I can do it manually through the Story Editor but have really set my eyes on the Story Splitter script created by Adi Ravid. I found its place @ the Adobe Exchange (http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=1302 518#)  but get an error "We're sorry, we encountered an error processing your request." - also when pressing "Email author: Adi Ravid".

 

So, could someone who has the script please post it here?

 

Thanks a lot in advance

Extracting single pages out of InDesign documents

$
0
0

Is it possible to extract or export single pages from an InDesign document?

So far I've done it this way: I remove all the other pages, save to a new document and reopen the original document.

Here's my script https://gist.github.com/2964807

 

But obviously this is more of an hack. And the problem is that it's very obvious to the user, as the document is closed and re-opened. Is there a cleaner way of doing it?

 

Thanks in advance for your help.

How does columnSpan work? [JS][CC2014]

$
0
0

Some background info:

I'm using InDesign CC 2014 latest version

I have a simple table set up: 6 columns by 5 rows

 

I want to check if the first cell in the first row is merged, and if it isn't merged, merge the first 4 columns of the first row. So I wrote this javascript:

 

myDoc = app.activeDocument,

myPage = myDoc.pages[0],

myTable = myDoc.stories.everyItem().tables[0];

var checkMerged = myTable.rows[0].cells[0].columnSpan;

alert(checkMerged);

//merge the cells if not already merged

if (checkMerged === 1){

   myTable.rows[0].cells[0].merge(myTable.rows[0].cells[3]);

    } else {

        alert("Merged");

        }

 

When the cell is not merged, the alert returns "1,1,1", when it is merged, it returns "4,1,1".

 

on this page: Adobe InDesign CS6 (8.0) Object Model JS: Cell it says that columnSpan is a readonly number, but it looks like an array.

 

Please help. I feel like I'm taking crazy pills.

 

Thanks

Suppress dialog when executing jsxbin file from app.doscript

$
0
0

I am using InDesign CS6, and am writing a loop script in ExtendScript Toolkit CS6 (Extendscript 4.2.12 ScriptUI 6.1.8)

 

I am using a jsxbin file inside a loop.  After the jsxbin file is finished a script alert popup dialog appaers saying it is done and I am forced to click the ok button before it will allow my script to continue.  I am running the jsxbin file from app.doscript("[jsxbin string here]").  I tried changing the user interaction level to never interact before running the doscript, but this did not have any effect.  Is there a way to run the userInteractionLevels.NEVER_INTERACT as a parameter in app.doscript?  OR, is there a way to automatically close the script alert popup when it opens.  I am trying to avoid having to hit the OK button multiple times as the script runs.

 

I am fairly new to writing script in InDesign.  Any advice or assistance would be greatly appreciated.


How to set a keyboard event, which can response to dropdown list?

$
0
0

Hi every one

 

 

Can you set a keyboard keydown event for select the dropdown list item?

 

Thanks

Regard

John

 

 

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

var

  w = new Window('dialog {orientation: "row", alignChildren: ["", "top"]}',"Indesign Tricks Wizard_Beta_V3", undefined, {closeButton: false}),  

  stringList = ["01   Close and SAVED",                                                        //       0

        "02   Close WITHOUT save",                                                   //       1

        "03   Save all files",                                                                //       2

        "04   Reverse",                                                                        //       3

        "-",                                                                                          //       4

        "05   Remove empty pages",                                                  //       5

        "-",                                                                                          //       6

        "06   Update years on Master in all opening Doc",               //       7

        "07   Years + 1 in Specific cells",                                          //       8

        "08   Copy and paste to Next Master",                                 //       9

        "-",                                                                                         //       10

        "09   Bring Styles and Swatches to next Doc",                      //       11

        "10   DEL and Replace Color",                                               //       12

        "11   Remove unused color",                                                 //       13

        "-",                                                                                         //       14

        "12   Remove missing link in all open files",                         //       15

        "13   Remove layer and missing link ",                                  //       16

        "14   Batch import styles from source document",               //       17

        "-",                                                                                         //       18

        "15   Gen Revised PDF",                                                        //       19

        "16   Report empty return at top",                                       //       20

        "17   Find-Change Paragraph Names",                                //       21

        "-",                                                                                         //       22

        "18   Break link from story",                                                //       23

        "19   Joint link to story",                                                       //       24

        "20   Extract pages",                                                            //       25

        "21   Joint text fame together",                                           //       26

        "22   Resize selected text"],                                                //       27

                       

                       

  mReminderString = "\"Batch import styles from source document\" usually cause indents problem.",

  lastSelected = Number(app.extractLabel("dialogWizard") ),

  p = w.add("panel", undefined, "Choose a job to do:"),

  s = p.add("group"),

  mDD = p.add("dropdownlist", undefined, stringList),

  mRem = p.add("statictext", undefined, mReminderString, {multiline: true} ),

  b = w.add('group {orientation: "column"}');

 

     mDD.preferredSize = [320,20];

     mRem.preferredSize = [320,30]; // set reminder height as 20 * line count (here 2 lines)

     if ( !lastSelected ) mDD.items[0].selected = true;

     else mDD.items[lastSelected].selected = true;

 

// |||||||||||||||||||||||||||||||||||||||||||||||| modify reminder font here |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

         w.graphics.backgroundColor = w.graphics.newBrush (w.graphics.BrushType.SOLID_COLOR, [1, 0.26, 0.2]);

     mRem.alignment = "left";

     mRem.graphics.font = ScriptUI.newFont ("Arial", "Bold", 11);

     mRem.graphics.foregroundColor = mRem.graphics.newPen (w.graphics.PenType.SOLID_COLOR, [1, 1, 1], 1);

     p.graphics.font = ScriptUI.newFont ("Arial", "Bold", 10);

     p.graphics.foregroundColor = mRem.graphics.newPen (w.graphics.PenType.SOLID_COLOR, [1, 1, 1], 1);

     mDD.graphics.font = ScriptUI.newFont ("Arial", "Bold", 11);

     mDD.graphics.foregroundColor = mRem.graphics.newPen (w.graphics.PenType.SOLID_COLOR, [1, 0.26, 0.2], 1);

// ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||

 

        var myIcon = "";

        var ib = b.add ('iconbutton', undefined, myIcon);

              ib.onClick = function() {

                     w.close(1);

                }

        w.addEventListener ("keydown", function(k) {if (k.keyName == "Enter") w.close(1);})

// ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||

        b.add ('button', undefined, "取り消す", {name: "Cancel"}); 

// ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||

 

w.show();

 

 

 

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Soft enters for table column head breakup

$
0
0

Hi,

 

Can i have any option for the the below requirement?

 

I need to give soft enters for all table column head breakup's. (see the below screen shot). When i export to HTML the column heads are run-in against the PDF output.

 

Softenters.jpg

 

Regards,

Velu

batch-find-and-replace.jsx

$
0
0

Hi there, I wrote a batch-processing script for find change queries and thought I share it with you. You can get it over here 

You can process GREP, TEXT, GLYPH and OBJECT searches. 

Purpouse

While creating books in InDesign with several documents we always come across some find change queries that need to be used again, and again, and again. To make this process easier you can just grab their names and put them into a list. The script will than try to process all your queries in one click. 

prerequisites

  1. make sure you have a toml file.
  2. make sure the toml file is next to the script.
  3. make sure the toml file has the right formatting (see below in section TOML)
  4. if you want the script to autoexecute (without toml file selection), make sure the .toml file has the right name: "batch-find-and-replace.toml"
  5. make sure your fcqueries work right

Usage

  • Place the script and the toml file into your Scripts Panel Folder 
  • define some find and change queries and save them via the InDesign dialogue.
  • get the xml file names and add them to the "batch-find-and-replace.toml" file in the right spot. text search goes into text.files = [], grep search goes into grep.files = [] and so on. Make shure to remove the .xml from the filename. You can find these files on:
    • Mac OS Users[username]\Library\Preferences\Adobe InDesign[Version][Language]\Find-Change Queries[query type] 
    • Windows XP Documents and Settings[username]\Application Data\Adobe\InDesign[Version][Language]\Find-Change Queries[query type] 
    • Windows Vista and Windows 7 Users[username]\AppData\Roaming\Adobe\InDesign[Version][Language]\Find-Change Queries[query type] 
  • the .toml file should be located next to the script file and have the  appropriate name (batch-find-and-replace.toml). If so the script wont ask for the toml file and process the data right away. If not the script will ask you to select the .toml file.
  • Thats it. Watch the magick happen.

TOML

Tom's Obvious, Minimal Language is a simple markup language that makes settings human readable. It is still in development and may change a lot. But still. It is a pretty easy language and can be learned by anyone.
The basic toml filer looks like this: 

# these are the basic settings
# the MUST be there
do_text = true
do_grep = true
do_glyph = true
do_object = false
# now the file names
# they have to be in one line
# the toml specs say you can break lines in arrays
# but the toml.js does not allow that at the moment
[text]
files = ["my_first_text_find_and_change","another one"]
[grep]
files = ["somegrepsearch", "find tabs", "something else"]
[glyph]
files = []
[objects]
files = []

MUST HAVE Settings

With the do_text, do_object, do_grep and do_glyph you can define if the script should do the corresponding find and replace. Set them to true or false.

CAN HAVE Settings


In the [text],[grep],[glyph] and [objects] areas you can define the filenames that should be processed. Make sure the filenames are written right. If there is a file mentioned that does not exist the script will throw an error. It will try to process all the .xml files it can find.
!IMPORTANT! you MUST remove the .xml from the filename in the list as shown above.

 

The Script is here --> https://raw.github.com/...find-and-replace.jsx

The basic .toml file here --> https://raw.github.com/...ind-and-replace.toml

The Readme here --> https://github.com/...lob/master/README.md

And the whole package here --> https://github.com/...e/archive/master.zip

JS: How to remove duplicate items from an Array?

$
0
0

JS: How to remove duplicate items from an Array?

I guess there will be a simple way ...

which column [left or right] presented my current text frame and how to identify?

$
0
0

Dear All,

 

Which column [left or right] presented my current text frame and how to identify?

 

please suggest anyone.

 

regards,

~jack

WaxRun

$
0
0

Hello,

 

In the SDK you can access a WaxRun, here is how the documentation describes a waxrun.

"

wax run is created each time the appearance of the text changes within the line. Examples of this include changes in point size, changes in font, and the interruption of the flow of text in a line because text wrap causes text to flow around another frame. "


A textStyleRange doesn't quit do it.


Any way to get this via scripting?


Thank you.


P.

 

Table style that keeps column width

$
0
0
I have irregular column widths that need to be part of a table style. Does anyone know of a script that would incorporate the irregular column widths in a table (preferable) or cell style?

Find Grep And Ignore the line break

$
0
0

Hi Guys!,

 

 

In my document having the text of "application \nfor you"

 

Then, I need to ignore the line break in entire text indesign document.

 

please help me!

 

 

 

Thanks by

John Peter.

ANN: automatic dialog after background export (exportPop.jsx)

$
0
0

A week or two ago, I wrote a script to pop up a dialog box after any background export, in response to the InDesign CS5 PDF export status thread. It doesn't seem like there's been feedback. I suspect it's sort of gotten lost in the noise in the general forum. So here we go again!

 

Don't make me post it to InDesign Secrets!

 

This script will automatically pop up a dialog box after every export finishes (PDF, IDML, whatever). It also makes sure that the Background Tasks window is turned on.

 

You can download the script from here, or just paste in what follows and save as exportPop.jsx. See How to Install InDesign Scripts for installation instructions. If you save it in the Startup Scripts folder, it will run automatically when InDesign is started. Running it a second time disables it, if for some reason it causes problems.

 

// exportPop.jsx -- pops up Background Tasks when you start an export
//   and a modal dialog when an export finishes.
// Beta version. Please post feedback at
//   http://forums.adobe.com/thread/830572
// John Hawkinson, 17 March 2011
// Save in STARTUP SCRIPTS folder to start automatically.

#targetengine session

(function() {
    var        old1 = app.eventListeners.itemByName("exportPop1"),        old2 = app.eventListeners.itemByName("exportPop2");           if (old1.isValid || old2.isValid) {        if (old1.isValid) { old1.remove(); }        if (old2.isValid) { old2.remove(); }        alert("Export pop up window removed.\n"+            "Indesign will behave as normal.");        return;    }       app.addEventListener("beforeExport", function() {        var            tasksPanel = app.panels.itemByName("Background Tasks");        if (tasksPanel) { tasksPanel.visible=true; }    }).name = "exportPop1";       app.addEventListener("afterExport", function(ev1) {        var task, listener;                   task = app.idleTasks.add({ name: "exportPop", sleep: 1000});        listener = task.addEventListener(IdleEvent.ON_IDLE,            function(ev2) {                listener.remove();                task.remove();                alert(ev1.format+" export complete of "                    +ev1.fullName+" at "+ev1.timeStamp);            });    }).name = "exportPop2";    alert("Export pop up window installed\n"+        "Background Tasks will appear the start of an export\n"+        "and a dialog will appear after each export complete.");
}());

Mark text with no CharacterStyle

$
0
0

Dear Indesign Scripters,

 

I'm looking for an way to mark text (red and bold for example) that has no CharacterStyle.

 

Is this possible?

[JS] Table RowTypes.BODY_ROW

$
0
0

Hello,

Is itpossible tosimpliedthisloop?

And she'll ask meif I havea problemSEVERALlinefeet...I'll have tobe moreprésit


thank you

// -----

Bonjour,

 

Est-il possible de simplié cet boucle?

Et elle vas me poser un problème si j'ai plusieur ligne de pieds ... je vais devoir être plus présit

Merci

 

 

for (y = (monTableau.rows.length-1); y >= 0; y--) {

   if (monTableau.rows[y].rowType != RowTypes.BODY_ROW) {   

        monTableau.rows[y].rowType = RowTypes.BODY_ROW; // OK  convertion ligne d'en-tete

    }

}

Problem with save preflight report using javascript in macintosh

$
0
0

Hi Experts,

 

I need to generate preflight report from InDesign CS5. But I got a error in "ExportPreflightReport.jsx"

 

Here is my code:

 

    var myDocument = app.activeDocument;

    var myProfile = app.preflightProfiles.item("IMAGE_CHECK");

    var myProcess = app.preflightProcesses.add(myDocument, myProfile);

    myProcess.waitForProcess();

    var myResults = myProcess.processResults; 

    if (myResults != "None"){

          myProcess.saveReport(File(File($.fileName).path+"/myreport.pdf"));

   }

 

Please provide suggestion anything wrong in my code.

 

Thanks

Velladurai.G

Viewing all 15932 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>