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

Cannot show link: selected item is hidden in overset text.

$
0
0

After place the word document in to indesign application. It shows Cannot show link: selected item is hidden in overset text.

 

How to avoid this issue via scripting


[CS6/JS] Best practices checking whether eventListener already exists or preventing duplicate calls?

$
0
0

Running the following piece of code in a script will register a javascript function named "afterSelectionChanged" to be run as soon as the selection is changed – the second parameter is the function name:

app.eventListeners.add("afterSelectionChanged", afterSelectionChanged);

 

My problem concerns unregistering this event listener, or rather preventing it from being registered again. I'm using a specified "targetengine", so running the script again and again will add a new function to be called every time the script is started, resulting in the same function being called multiple times.

 

In the main function (startup) of my script, I could loop through the app.eventListeners collection, and remove any eventListeners whose .handler == 'afterSelectionChanged()' or eventType == 'afterSelectionChanged' like this:

 

for (var elIndex = app.eventListeners.length-1; elIndex >=0; elIndex--){    if (app.eventListeners[elIndex].eventType == 'afterSelectionChanged'){        app.eventListeners[elIndex].remove();    }
}

Is this a good practice?

Or is it unnecessary to check for specific event names at all, that is: should I rather remove all eventListeners, or could that disturb something? I have a #targetengine directive with a specified name, at the top of my script.

 

Are you supposed to try to remove all eventhandlers and / or kill your targeted engine when a ScriptUI window is closed?

 

Thanks,

Andreas

Double quotes character converted from 1 byte to 2 bytes

$
0
0

When i place a text file to a textframe in Indesign file, double quotes characters converted from 1 byte to 2 bytes.

Please tell me, how do i prevent this.

Folder.getFiles Multiple Filters Mask

$
0
0

Hi all,

 

Folder.getFiles (".*") ... in this case it will get all types of files

 

Folder.getFiles (".jpg") ... in this case it will get all files with .jpg extension

 

... but how can I filter to get (for example) all files with ".jpg", " .tif" or ".eps" extension ?

 

ESTK help says: A mask string can also be the name of a function that takes a File or Folder object as its argument. It is called for each file or folder found in the search; if it returns true, the object is added to the return array.

 

Any idea of how to make such a function?

 

I will appreciate any help.

convert pages to layers

$
0
0

Hi All

 

I have an indesign document which has multiple pages (this one for example has over 200) with base layers of "footer", "content" & "background" and I would like to change it so that each page is on 1 layer so example all elements on page 1 convert to layer 1 and so on is this possible and does anyone have a script that could do this?

 

Thanks

 

cp_vdp_user_2015

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

Overtype in indesign CS5

$
0
0

How can i activate overtype in indesign CS5

Unicode

$
0
0

How to find the Unicode for non keyboard character using indesign script


How to export untagged XML files to XML

$
0
0

Hi Everyone,

 

I'm a financial typesetter, I wanted to know how to export the untagged XML InDesign files into XML files.

 

The files are basically created in InDesign directly(non-XML workflow).

 

When i tried to export the XML, i will receive the below error:

 

"<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

<Root/>"

 

Could you please suggest any one, is their any option to convert non-XML files to XML.

 

Thanks in advance.

Uv

Face or shape detection?

$
0
0

I work with a magazine that prints mug shots of criminals. I get the mug shots of the people's faces, and I have tons of them to put on my layout. They are all different sizes, and right now I have to go through by hand and resize each one to fit it inside the image frame so that that face fills up the frame and is not cut off. Is there any type of script that could somehow detect the face or shape of the people and automatically size them to fit within the image box? If not, does anyone know an easier way for me to do this? It takes forever because I have hundreds to do.

 

Thanks!

Is there a script/keyboard shortcut for: Go from cursor inside text frame(with table) to a cell in the table...

$
0
0

I have a handy script-keyboard shortcut that goes to beginning-of-paragraph cursor inside a text frame. If I have a text frame with a table selected and I hit this shortcut it takes me to the long cursor left of table. But from there I have no keyboard shortcut to get "into" the table (any cell would do) Does anybody know of a shortcut/script that would do this? I assume that only a script would be able to accomplish this. Anybody? Or is there any scripting tutorial that focuses on navigation that might help me develop my own?

Automate File Updating using JavaScript

$
0
0

I have a project that requires updating about 2,000 files with some new OSHA icons and text. Some of the files are various versions of Quark and the others are in ID. I am using CC 2014 on Mac Mavericks.

 

I will begin converting the Quark files using Q2ID. Then I am hoping to write and run a JavaScript to place the images and edit the necessary copy.

 

2 Questions

1 - Will a JavaScript run from ID CC 2014 be able to open files from older versions of ID?

2 - Is there a guide to scripting for ID CC 2014?

 

In my web search, I only found ones for older versions. The most recent one I found was for CS 6 InDesign developer documentation | Adobe Developer Connection

 

Any other thoughts or suggestions on how to attack this project are appreciated.

Unexpected result of: myCell.contents

$
0
0

Hello,

 

I have an Indesign-Table with 4 Rows, it contains Text in the2nd and 3rd row.

 

We can read the cell-Content of the 2nd row, however we can't read the cell-Content of the 3rd row.

The code-line firstCellOfThirdRow.contents should provide the value: "MyTextB". However we get a cryptical letter which looks like 'T'.

Any ideas ?

 

MyTextA
MyTextB

 

 

The Indesign-Template:

http://www.com-active.de/downloads/ProblematicTable.zip

 

Here's the code:

 

// Second Table-Row
var secondRow = myTable.rows[1];
var firstCellOfSecondRow = secondRow.cells[0];
var content2 =  firstCellOfSecondRow.contents;  // "MyTextA"

 

// Third Table-Row
var  thirdRow = myTable.rows[2];
var firstCellOfThirdRow = thirdRow.cells[0];
var content3 =  firstCellOfThirdRow.contents; // I expected "MyTextB", but that's not the case. Why?

more efficient right aligned page numbers in TOC

$
0
0
In order to right align the page numbers in a table of contents, after generating the TOC, I need to manually insert a tab character to the left of each automatically generated page number.

I'm looking for a more efficient way to do this. Is there a script that would do this automatically or maybe a GREP find/replace routine?

Script 2 pdf outputs?

$
0
0

I'm looking for a workflow solution where it's required to output 2 pdfs, one for production and one for proof.

 

Basically, it's a pain in the hoop to create 2 pdfs each time.

 

What I'm looking for is a way via script to export to PDF

Chooses currently open PDF(s)

 

Dialog box looks something like:

 

PDF Production

<Choose PDF Joboption> | <Current Filename> | <Choose Location>

 

PDF Proof

<Choose PDF Joboption> | <Current Filename> | <Choose Location> | Append Filename [_xx]

 

Be great if the Script recognised current folder the file is in.

 

 

Any help is appreciated.


Specify ID for InDesign objects

$
0
0

I have a need to assign a unique ID to an object (typically a text or graphic frame).  I then will export the document to EPUB, open the EPUB, find the object and inject some content into it (as well as updating some other parts of the EPUB).  I see that InDesign assigns unique IDs to the various HTML entities that it exports, but the IDs appear to be generated according to the type of object and some internal, sequential number series. Is there a way to assign my own ID via the UI of the application?  Or, alternatively, is there a way to determine, while I am creating/editing the document in InDesign, what that unique ID is/will be?

Change link path

$
0
0

I am looking for a way to change the file path of all my links in a document. I just need to remove part of the file path...

If the original file path is
/Volumes/My Passport/HiRes/990/9906.psd

and I need to make it

HiRes/990/990.psd

 

Is there an action script or some hidden trick to rename all the links?

I'm working on a mac in OS 10.9.5

 

Thanks for any help!

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

Image replacement

$
0
0

Hi,

 

Is there a script available in InDesign for replacing Low resolution images with High resolution.

Both image have same name, only folders are different.

 

Kind of a OPI function.

 

Hemanshu

[CS4/JS] Spirographs -- a.k.a. "Guillochés

$
0
0

A discussion of the spiral graphics as seen on money (and postal cheques, and some of the more expensive lottery bills) on Typophile prompted me to try this in InDesign. It turned out not to be beyond my capabilities! Here is a nice concise script that draws these intricate patterns -- now you can design your own $3 bill!

 

Using the formulaes from Wolfram on hypotroichoids. Vary the variables at the top for nice patterns; a is the "outer", main radius, b is the "inner" rotating radius, and h is the thickness of the outer rim. (Wrapping it up with a nice dialog is "left as an exercise", meaning I didn't feel like doing it.)

 

Not explained on that web page, but the number of rotations to get a complete curve seems to be the greatest common factor of a and b -- I discovered that empirically so I might be wrong about that.

 

Written using CS4, but I can see no reason it should not work all the way down to 1.0, or up to CS5. Best appreciated with your measurements set to millimeters. Warning: the Greatest Common Factor function does not work well with fractions!

The number of points per path is clipped to a measly 10,000, because I suspect InDesign will suffer from overly long paths.

 

app.activeDocument.zeroPoint = [ app.activeDocument.documentPreferences.pageWidth/2, app.activeDocument.documentPreferences.pageHeight/2 ];

a = 80;
b = 13;
h = 20;

path = [];

nLoop = b/greatestCommonFactor(a,b);

p = null;

for (t=0; t<=nLoop*360; t+= 0.5)
{     x = (a - b) * Math.cos(t*Math.PI/180) + h * Math.cos (t*((a - b)/b)*Math.PI/180);     y = (a - b) * Math.sin(t*Math.PI/180) - h * Math.sin (t*((a - b)/b)*Math.PI/180);          path.push ([x,y]);     if (path.length > 10000)     {          if (p == null)          {               p = app.activeDocument.graphicLines.add().paths[0];               p.parent.strokeWeight = 0.1;          } else               p = p.parent.paths.add();          p.entirePath = path;          path = [ [x,y] ];     }
}

if (path.length > 1)
{     if (p == null)     {          p = app.activeDocument.graphicLines.add().paths[0];          p.parent.strokeWeight = 0.1;     } else          p = p.parent.paths.add();     p.entirePath = path;
}

function greatestCommonFactor (x,y)
{
     while (y != 0)     {          w = x % y;          x = y;          y = w;     }     return x;
}
Viewing all 15932 articles
Browse latest View live


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