Quantcast
Channel: Adobe Community : All Content - InDesign Scripting
Viewing all 8771 articles
Browse latest View live

Need image name display

$
0
0

Dear Friends,

 

I have working "InDesign cs6", i need image name place in nearest  corresponding images, please see below the screen shot, anybody have script for this, if you have please provide.

 

Need image name label in nearest image. Please see below the model. Kindly provide.

 

image name.png

 

 

Thanks for your help

kanaga kumar. k


Placing a snippet

$
0
0

How can I make a simple script that places a spesific InDesign snippet in the document, at cursor point?

Just like when draging a snippet in to a document.

 

Im on a Mac

How to alphabetical order pages at indesign cs4?

$
0
0

I have a text box at the beginning of each page and I want to alphabetical order pages based on that text box. Do you know how to do that?

Stacking, Snapping & Align in one script

$
0
0

Try to imagine a series of 4-5 elements errantly on the page.

 

And a script that Ungroups if grouped, that Aligns to the nearest column guide left, and that Distributes Vertical Spacing using 0p0 values.

 

Does anyone have a trick up their sleeve?

GREP expression help to find broken paragraphs

$
0
0

My goal is to find paragraphs that are broken in between a sentence (see image) and fix them into a complete sentence. My approach was to find a carriage return ("\r") with a negative look behind targetting puncutations (.,?). It works fine but it also ends up selecting double returns(the empty paragraphs when i hit enter twice). Any thoughts on how i can avoid that?

 

GREP:

 

(\s*?)(?<![\.\?])\r

 

 

Screen Shot 2014-01-14 at 1.12.30 PM.png

GREP Commands from CS3 to CS6

$
0
0

Hi All

 

we got some GREP tags which we copied from InDesign CS3 to InDesign CS6. Is it possible that those tags don't work anymore? we use [[:punct:]] for example, but InDesign don't recognize the input...

 

Did Adobe made changes in CS6 the GREP process?

 

Thanks for your support!

 

Reto

grep to format numbers in [ ]

$
0
0

hello, I have citations in text which appear in such pattern as [1] or [1-3] or [1, 3-5, 4, 7-10]. I want to use blue color for the numbers in the pattern but everything (, or -) else remain black. I use this grep ((?<=[\[]))([[:digit:]]+(,\s|-))*[[:digit:]]+  which gives me blue color for every thing. How can I just blue color the numbers?

 

Thank you.

Highlight text using conditional text

$
0
0

Hi,

 

 

     I need to highlight text using conditional text in InDesign.  I can highlight text using the below code.

 

 

var myDoc = app.activeDocument;

colorToHighlig = myDoc.conditions.add ({name:"Yellow",indicatorMethod:ConditionIndicatorMethod.USE_HIGHLIGH T, indicatorColor:UIColors.YELLOW});

app.findGrepPreferences = app.changeGrepPreferences = null;

app.changeGrepPreferences.appliedConditions = [colorToHighlig] ;

app.findGrepPreferences.findWhat = "chapter";

myDoc.changeGrep();

 

ConditionalTxt-IndicatorMode.png

 

But I need to set Indicator to "Show and Print" coz while generation pdf with indicator mode "show", highlights are missing in PDF.  I can retain those highlights with the indicator mode "Show and Print". Dono how to set it..

 

If anyone know, pls help me.

 

Thanks in advance,

Sudha K


exportFile() - export selection option via script?

$
0
0

Hello,

 

From InDesign, I can select a group/textFrame/pictureFrame, and then click File -> Export. From this dialog, after I select my "save location," I can then choose to "Export Selection" by selecting the "Selection" radio button.

 

I'm wondering if this is possible to do with a script? The reason I ask is because I need to export single picture frames (actually, grouped frames, there will be text frames grouped with picture frames). In the SDK I see exportFile() options where you can select if you wish to export as PDF, IDML, JPG, etc. But nothing on "exporting selection". Does anyone know if this is possible, and if so, how it is done?

 

I know there is a bool you can set to "true" to display the dialog, but this all needs to be automated. Anyone have any thoughts on this?

 

Thanks in advance!

 

-Lloyd

How do I write a javascript code to open InDesign template, import XML, save and export to pdf?

$
0
0

How do I write a javascript code to open InDesign template, import XML, save and export to pdf?

 

I mostly need the help with writing the javascript code to open the InDesign file, import some xml that will be randomly coming in and then saving the document.

How to get Track Changes inserted / deleted text?

$
0
0

Hi,

 

I read the Adobe InDesign CS6 JavaScript Scripting Guide and wrote a JavaScript as below:

 

var myChanges = app.documents.everyItem().stories.everyItem().changes;
var myString = '';
for (var i=0; i<myChanges.length; i++) {        var myChange = myChanges[i];        myString += myChange.userName + '\t';        myString += myChange.date + '\t';        myString += myChange.changeType + '\n';
}
alert(myString);

 

My script can get the user name, date and change type.

 

But the guide has not cover on how we can get the insert / delete modifications?

 

Many Thanks!

Getting the offset of a placed PDF within the container rectangle

$
0
0

I need to get the offset of a placed PDF inside of the container rectangle. I have figured out that this information should be available in the transformationMatrix of the placed file. So I do something like:

 

var pdfTransform = pdf.transformValuesOf(CoordinateSpaces.pasteboardCoordinates)[0];

var horzTranslation = pdfTransform.horizontalTranslation;

var vertTranslation = pdfTransform.verticalTranslation;

 

but the coordinates I get back are just weird. The horizontal value seems reasonable, but the vertical is way off what I expect.

 

There may be some precondition to doing this that I'm missing. Running the pageitems/TransformValuesOf.jsx sample from the Scripting Guide also gives weird values. That sample creates a rectangle with a center point of [0, 0] and then retrieves the transform. I would expect the translation to be [0, 0] but I actually get [5, -415.95] (horz, vert).

 

In that sample it talks about ruler coordinates, so I tried setting document.viewPreferences.rulerOrigin to different values, but that does nothing.

 

I'm stumped. Can someone please give me a hint on what's going on here?

Remove images on page

$
0
0

I make an if satement in a loop (going through all the pages in the document) and want to remove all images on a single page if the if-statement is true.

Can someone please help me to get the right code for remove all page images (imageframes)?

 

(In Javascript)

Dictionaries

$
0
0

Hi All,

 

I need to add words in the Target menu "bbbb.indd"(active document) not for "User Dictionary".

 

But my below coding add words in the User Dictionary only.

 

 

var myUserDict = app.userDictionaries[21]; 
alert("D: "+myUserDict.name); 
wordsArray = ["at~cok","bb~ote","ar~su", "si~raj"]; 
myUserDict.addWord(wordsArray);     
alert("Completed\n");

 

 

For more clarification, please refer attachment...

 

target indesignfile.png

 

Kindly do the neeful for my request.

 

Thanks in advance

Siraj

Anybody can help me for RTF conversion?

$
0
0

Anybody can help me for RTF conversion for selected text frames only in Indesign by script


[AS][CS6]Apply different styles in one text frame

$
0
0

Hello,

 

Currently, I have an AppleScript to fill a single text frame with a series of strings:

 

tell MyTextFrame to set (contents of parent story) to MyText1& MyText2&MyText3&MyText4

 

I would like to apply a different style (MyStyle1 to MyStyle4) to each of these strings (MyText1 to MyText4).

Accuracy: MyTexti strings can contain a word or a paragraph or more, so I cannot apply a style to a paragraph, for example.

 

Thomas

Insert an image if it does not already exists on the page

$
0
0

I'm coding one if satement in a loop (go through all the pages). I want to place a picture on every page, but only if it does not already exist, for instance if the script is run before.

 

Any suggestion on how to code this?

CS6 javascript - textBox.contents doesn't return full text

$
0
0

I'm using script labels to find text boxes of a certain label and get their contents. Sometimes I don't get the full contents back. Is there anything I should be checking to find my error? This is the js I'm using:

 

 

 

var myDoc= app.activeDocument;

 

var myPageItems = myDoc.allPageItems;

 

for (var i =0; i<myPageItems.length; i++)

{

    if(myPageItems[i].label == "rug details colors 1")  

    {

         var myOverFlowFrame = myPageItems[i];

 

         if(myOverFlowFrame.overflows==true)

         {

             var fullText = myOverFlowFrame.contents + '';                      

 

             alert(fullText); 

            }      

       }

  }

 

I don't have very much experience scripting against InDesign and would appreciate any help I could get. Is there a better way than .contents to get the text in a text box? Is there an obvious reason why it would fail to retrieve all of the text in some cases?

 

Message was edited by: rockymcclamrock (removed irrelevant code)

Making an event listener work (InDesign CC Windows 8).

$
0
0

Hello everyone.

 

I am tryingn to figure out how to make eventListeners work and something is just not clicking.

 

I wrote this very simple script that looks like this:

 

main();

 

function main()

{

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

}

 

function myEventHandler(myEvent)

{

    alert("Something was selected", "Selection change");

}

 

When I run this script through ExtendScript and then go to the document and select a rectangle, I get the following error message twice:

 

"The requested action could not be completed because the object no longer exists."

 

I attempted to run it through the scripts panel to see if that made any difference, but when I attempted to save the file Windows told me that I need to contact the administrator to get permission to write in the Scripts Panel folder.  I'm working on that while I wait for any answer that might come forth.

Can't find multiple words in GREP

$
0
0

Hi All,

 

I have to find 240 words using GREP in different type of conditions like an example:

 

(?i)(space)anusá(space)|(space)arseá(space)  - before and after space

(?i)^anusá(space)|^arseá(space)  - starting paragraph and after space

(?i)(space)anusá$|(space)arseá$  - space and end of paragraph

(?i)(space)anusá\.|(space)arseá\.  - space and end of dot

 

GREP can't capture full of 240 words, it is stoping the second condition itself, I am using this all as a continued text using | symbol.

 

can any one help me how to find simply

 

 

thanks in advance

simon

Viewing all 8771 articles
Browse latest View live


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