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

Script to Export INDD file as PDF, named to match containing folder, not original file name

$
0
0

All - I am trying to create a script to open an INDD file and export to PDF, not as the file name but as the name of the folder containing the PDF. Any ideas?


Merge different text boxes in InDesign one

$
0
0

Hi,

 

I have converted PDF2ID files, these files are showing different text boxes, if any scripting is there we can merge all text boxes in one box.

 

 

Thanks

Kishor

move table within a textframe?

$
0
0

Hii

Can anyone please tell me how can I move a table within a textframe?

Is it possible to do so using vb.net?

Please please help

 

Thanks

Export table as html with border

$
0
0

Hi,

 

   When i am exporting table into html file  using indesign javascript, its exporting table as html without border using the below code.

 

   How can i export the table with border using indesign javascript without css option??

 

htmlPath = File(app.activeDocument.fullName.fsName.replace(".indd",".html"));  

app.activeDocument.htmlExportPreferences.viewDocumentAfterExport = true;

app.activeDocument.htmlExportPreferences.cssExportOption = StyleSheetExportOption.NONE;

app.activeDocument.exportFile(ExportFormat.HTML, htmlPath, false);

 

Screen shot 2015-07-24 at 1.45.19 PM.png

 

 

Screen shot 2015-07-24 at 1.57.35 PM.png

 

Thanks in advance,

Sudha K

Preserve Local Formatting script and CS4

$
0
0

Unfortunately, Dave Saunders' amazing PreserveLocalFormatting.jsx script (that changes local formatting to character styles) doesn't work under InDesign CS4. I've tried running it both as-is and in the compatibility mode (putting it in a folder marked Version 4.0 scripts), and it seems to star to run, but doesn't actually do anything. Anyone more versed in scripts know what might be the trouble?

 

http://indesignsecrets.com/downloads/PreserveLocalFormatting.jsx

[JS CS3/4] ScriptUI How to color a button ?

$
0
0

Is it a way to get a colored button in the ScriptUI DOM ?

 

I tried

 

dlg.button1.graphics.backgroundColor = dlg.button1.graphics.newBrush(dlg.button1.graphics.BrushType.SOLID_COLOR,[0.7,0.7,0.7],1);

 

But although the dialog is drawn, the button is not styled in best case, not visible in the worst case.

 

Is that possible to get a colored button ?

 

Hope so.

 

Do you have any tip ?

 

TIA

 

Loic

Script for add images to indesign page by page.

$
0
0

Hello,

 

I have 200 pages with border in indesign and 200 images having in local folder. every image name is S1, S2, S3...etc. Need script to add S1 to indesign page1 with centre in the border.

Same for S2, S3..like that.

 

Please suggest any script for that.

 

Regards,

Sampath.S

Export SVG in Indesign CS5?

$
0
0

hi,

 

i know that adobe canceled svg support for indesign at cs3. but it's really important that i find a way to export svg by scripting. has someone a tip? plugins for this are no solution.

 

thanks in advance!


Textframe merge or grouping

$
0
0

Hi All,

 

First real stab at indesign scripting to set up some packaging artwork.

 

for component information on the box I am creating a textframe with all the various bits of info in there, ingredients etc. ince i have done this i create another 2 textframes each with an image in that tags onto the end of the weight line.

 

Now that i have these 3 textboxes on the page (i had multiple versions of these three) my script continues to work out where best to place this one the artwork based on available space and moves it with .geometricBounds. My problem is that I can't find a good way to group these 3 textframes and then relocate them to the new position.

 

is there a way of grouping or merging these 3 frames so that I can perform one command to move all 3?

XML attribute change

$
0
0

I need to replace the xml attribute value "M05_LEMO9433_06_SE_CH05" to M05_LEMO5401_06_SE_CH05

 

 

In document having more than thousand entries

 

 

I have used the below code but it is not working

 

 

function AddReturns(){

    this.name = "AddReturns";

    this.xpath = "//p//span//a";

    this.apply = function(myElement, myRuleProcessor){

 

 

        with(myElement)

  {

  try{

                   

              //      if (myElement.xmlAttributes.item("href").value.match ("LEMO9433 "))

                        {

                           

                            var fig = myElement.xmlAttributes.itemByName("href").value;

                            var    figv =  fig.replace ("9433", "O5401")

                            myElement.xmlAttributes.itemByName("href").value=figv;

 

 

                            }

                   

                   

  //myElement.xmlAttributes.item("id").name = "olinkend";

  }catch(e){}

 

        }

        return true;

    }

}

Applied character styles

$
0
0

Hi,

 

     Selection of text contains more than one character styles. I can get that styles by the below code.

 

var aCStyles = app.selection[0].textStyleRanges.everyItem().appliedCharacterStyle;

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

{

    alert(aCStyles[i].name);

}

 

How can i get that all character styles using single line like the below.

 

alert(app.selection[0].textStyleRanges.everyItem().fontStyle);

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.

Question about InDesign Track Change need help

$
0
0

Hi experts,

 

I want to find and reject track change, changeType.DELETED_TEXT. and reject it.

 

How can I do this.

 

How to make the script as below working?

 

Regard

John

 

#target indesign

var myDocument = app.documents.item(0);

var myStory = myDocument.stories.item(0);

var myChange = myStory.changes.item(0);

       for (var i = changes.length-1; i >= 0; i--) {

            var myChangeTypes = myChange.changeTypes.DELETED_TEXT;

            myChange.reject();

            }

Find/Change By List help

$
0
0

Hi all,

 

New to scripts here using InDesign CS6.

 

I need some help on how to set up the find/change by list script in InDesign. I searched the forums but I don't quite grasp if I need my list saved as a .txt file or something else and where to save the list.

 

I have a list of about 50 words (text only) (and growing) I'd like to simply find these words in my document, but not change them to anything as I need to rewrite the content to fit.

 

I'm hoping there is a find next of some sort with this script so I can search the entire set of terms in one shot. (I played with the Multi/Find change script (http://automatication.com/) but it looks like that requires me to "change all" rather than find all)

 

When I run the script in indesign it asks me to select a file to pull from. I currently have my list of text setup in a .txt file. (But not knowing code, I'm wondering if I need to save this text file differently or code it so the find/changebylist script can pull from this file)

 

Could someone point me in the right direction, or let me know if this is the correct script to use and how to use it?

 

I noticed in my script panel the find/change support folder (C:\Program Files (x86)\Adobe\Adobe InDesign CS6\Scripts\ mentioned on this site is missing from my folder.)
http://colecandoo.wordpress.com/2011/08/25/make-findchange-behave-more-like-a-word-macro/

 

Thanks for your help. Hopefully I get the hang of this soon.

Indesign: Export multiple groups as .eps

$
0
0

I have a product catalogue that I've created in InDesign and now I need to update the website with the new product images. The product images are linked .eps files that have dimensions added to them using lines and text boxes for the numbers. This is all then grouped together and there are a couple hundred of these all up.

 

The question is, is there a script that will export each individual group as an .eps file? So then I don't have to do it manually which would be a mammoth task.

 

Any ideas would be appreciated!

Adam


[CS4/JS] Mazes, Mazes, *Everywhere*!

$
0
0

A sample of what's possible when you combine Javascript with InDesign: a Maze generator.

 

I set out to find a Javascript that created mazes for HTML websites, but, while there are tons of those, they were not as easily converted to InDesign as I hoped. So I wrote one of my own using a description of Maze Generators on http://www.astrolog.org/labyrnth/maze.htm, but the code is entirely my own.

 

Screen shot 2010-09-17 at 2.10.18 AM.png

 

Not yet satisfied, I changed it from the usual rectangular shape to fill any object you care to draw! With this one constraint: curved edges are converted rather bluntly into straight lines. It won't work on a circle, for example (this will be 'straightened' into a rectangle), but it will work on, for example, a 5 pointed star!

 

Screen shot 2010-09-17 at 2.16.43 AM.png

Each small rectangle is about 5 mm wide and high, so make sure your object is large enough.

 

Download the code from my website: http://www.jongware.com/binaries/mazes-everywhere.zip

 

Start it in a blank document with no selection to get a crude "width/height" dialog, or draw a rectangle and have it selected to fill it with 5 mm wide maze paths. If you're feeling experimentally, draw polygons, or tack together a few shapes and combine their paths into one.

And if you're feeling really courageous, experiment with how to get 'holes' in your maze!

 

This one started out as Arial Black text, tracked to join the letters together; then it took some tries to get the "winding" of the holes right. (Techno-babble: There seems to be a bug in my code that doesn't always seems to return the correct winding order.)

 

Screen shot 2010-09-17 at 2.09.33 AM.png

 

Have fun!

Suggestions for changing tab with underline leader

$
0
0

I frequently create forms where I'll use a tab with the underline for the leader, e.g., Name_________________  Age___________, etc.

I like the line to be thinner than the text, say the text is 10pt I'll change the line to 8pt. I can do a Find/Change to change the Tab character to a smaller size, but that changes every tab whether it has a leader or not. I can't find a way to "Find every tab with a leader that's the underline and reduce the point size".

 

Any suggestions appreciated.

 

Geoff

JS/ScriptUI: placeholder madness

$
0
0

I created this yummy text box entry placeholder for CS4 on my Mac:

 

Screen Shot 2012-02-17 at 9.28.09 PM.png

 

but for some reason this fails to draw correctly on Windows! If the edit box is active and the cursor is in it, the text is not drawn but the cursor blinks at correct position at the end of that invisible text. Moving the cursor or typing in something makes the text pop back into view. (Sorry, should have thought of making a 'shot of that as well.) A real shame, because on my Mac it works as I meant it to: placeholder text shows when the field is inactive and empty, placeholder disappears when you enter the field and type anything in it. Delete text and leave box makes it appear again.

 

Is this an error in my code (silently corrected on the Mac but showing up on 'the other platform'), or is it an error on the Windows' Side of the world? Or is this just something one should not be messing with using ScriptUI? (A fairly reasonable explanation.) Or might it work correctly on CS5 for both platforms? (In which case I could put in a platform/version check -- "no fancy dialog for you, you Older Version on a Microsoft Platform!").

 

I also have a variant of same code that would underline static text, which also shows up correctly on Mac and not-at-all on Windows -- but then it may be failing for the very same reason.

 

My code:

 

var w = new Window ("dialog", "Display Placeholder");
w.bg = w.graphics.newBrush(w.graphics.BrushType.SOLID_COLOR,[1,1,1]);
w.textPen = w.graphics.newPen(w.graphics.PenType.SOLID_COLOR,[0.67,0.67,0.67], 1);
with(w.add ("group"))
{  add ("statictext", undefined, "Text");  editbox = add ("edittext", undefined, '');  editbox.characters = 32;  editbox.onDraw = function(d)  {    if( this.text || this.active)      this.parent.onDraw(d)    else    {      this.graphics.rectPath (0,0,this.size.width,this.size.height);      this.graphics.fillPath(w.bg);      this.graphics.drawString("<required>",w.textPen,0,0,this.graphics.font);    }  };
}

With CS2, some things have changed

$
0
0
I have not located a place where changes in scripting between CS and CS2 are reported, so I thought I'd start a topic here with some of the things I know about.

This is about changes to the object model that are not related to changes in the functionality that have taken place.


1. User Interaction Control
2. Table Labels
3. Parent Text Frame
4. New Beep Function
5. Find/Change symbol for End Nested Style Here
6. Convert to Table
7. Active Script in doScript
8. Text selections more specific

9. Table selections
10. Indexes
11. Basic Paragraph style
12. Enumeration Name Changes
13. Placed Assets
14. Previous Text Frame
15. Version Property
16. Add Page Reference (Index)


In describing these in the following messages, I'll use JavaScript terminology, but most of these issues are independent of the language.

word workflow

$
0
0

Hi, everyone

 

I have working in other language (Word Work Flow).

 

When flow word doc in indesign we have taking character style and space issues coming this to solve in JavaScript please any one help me.

 

Thanks,

Aarasan

Viewing all 15932 articles
Browse latest View live


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