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

Exporting a 6 pg document and changing a text frame on 1st and 6th page for each 50 times

$
0
0

I have these 6 page brochures and there are 50 marketing codes which need to be on first and 6th pages (different codes for each document exported). Rather than manually changing the marketing codes on the 2 pages 50 times (which takes too long) there has to be a easy way to do it. Anyone came across this?


Exporting data in tables to an Excel spreadsheet?

$
0
0

Is there a script or another way to export or save a documents tables (multiple tables over several pages) to an excel spreadsheet? I have found a solution which involves exporting each spread as a html file which i can then open straight in excel but this is still quite long winded and i can only seem to do this a spread at a time. As the job I am working on involves many pages this is taking too long. Surely there must be a script which can automate this in some way. I am fairly new to scripting so any help will be grateful. I have searched in scripting but nothing has really come close to what i am trying to achieve. Indesign CS5.5 user.

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 make my script ignore pages 1 and 2?

$
0
0

Hi all. I'm a complete beginnger at all of this so thank you in advance for all you're help, I really appreciated it.

 

I have a JavaScript that I've been working on, and with help from people on here it's working really well. I uses a combination of GREP expressions and checks the entire document and then applies pre-made Character Style that have been set up in the InDesign Templates. (By the way I'm using CS6).

 

My latest problem is that I don't want this to affect page 1 or 2 as the templates are layed out in spreads so these are the front and back cover.

 

Is there a way I can get the script to ignore page 1 and 2?

 

If not, I thought another way round would be to only have the script run on highlighted text, but I'd prefere to just ignore pages 1 and 2.

 

Any and all help would be greatly appreciated.

 

Thanks again,

 

Scorpio

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);    }  };}

ExtendScript - Waiting Message?

$
0
0

I'm having a bit of an issue when trying to select my target in the ExtendScript ToolKit. When I select InDesign as the target, it launches the application but ESTK sits there with a message box saying "Waiting; press ESC to abort..." It appears that it's not able to communicate with the process at all, and I'd love a little help debugging this. Anyone have any ideas?

 

 

Thanks!

Search text variable and replace it with another text variable

$
0
0

Hi, I want to do the following with VB script.

Can someone help me?

 

I have a document with text variable A and text variable B are defined.

And, text variable A is used in the document.

 

1.search all text variable A from the document

2.replace text variable A to text variable B

3.delete text variable A

 

Thanks.

erieru103

InDesign Script to wait for file to open before continue

$
0
0

Hello as above i have a simple script to select a file to open froma folder and tthen open it.

However the code continues as the file is still opening

is there a way to get the script to wait for the selected file to finish opening before continuing?

var file1 = File.openDialog();

file1.execute();

//rest of the code with the file open

 

thanks


Page number of replaced text

$
0
0

I am using a customized version of the FindChangeByList Script included with inDesign. What it currently does is output to a log file with all the changes made in the document and the total of changes made.

 

I would like to add a page number to each of the changed items but so far have not been able to find a way that actually shows that page number. Is this possible?

 

Thanks in advance,

 

Brad

How to print PDF with H&J Highlights

$
0
0

Hi

 

I need output pdf with H&J Highlights, so that we can validate the H&J without native file. Is there any options in applesctipt/javascript.

 

Thanks in Advance

Move URLs in Text to End of Story Or Link Text. Also: Tables

$
0
0

Hello everyone

 

I'm currently working on a script that translates Textile Markup into formatted InDesign-Text. This worked fine for the most part, seeing as it's not really hard to do by FindChangeByList. Some things are a bit trickier than other things, though. Namely URLs in the text. In Textile, all URLs are like so. Let's say I'd like to link to Google. So I'd type this: "Google":http://www.google.com This would produce Google. I can isolate the word and delete the URL by [\\\"](.+?)[\\\"]:\\?\\S+ and then replacing by $1. So far so good.

 

However!

 

It would be awesome, if the URLs were still in the text. So I'd either like to have it like so: Google or that the word Google (or any $1, really) stands in the text and then the link is added to the end of the text as a kind of "Sources"-paragraph-thing. How can this be done? Can I do it by FindChangeByList? Because that would be cool, seeing as then I'd only need to run one script.

 

And here's a general question: How can I translate Textile-Tables into Formatted InDesign-Tables?

 

For reference, this would be a table with one header row.

 

|_. name |_. age |_. sex |

| joan | 24 | f |

| archie | 29 | m |

| bella | 45 | f |

 

Can this be done?

 

Thank you very much for your help!

How to place an asset from the library to all pages via JavaScript?

$
0
0

Hello, I'm newbie in scripting that's why I need a help from one who knows. I need a javascript to place an asset from the library to all pages of my document.

I've tried to do it but all i have :

 

var myLibPath = (File("C:/Library.indl"));

var myLib = app.open(myLibPath);

var libItem = app.libraries[0].assets[0].placeAsset(app.documents[0]);

 

this places asset to the selected page only, may be someone can tell me how can it works for all pages.

 

Thanks!

[JS] Test fused cells (merge)

$
0
0

Hello,

Is itpossible to test whethera cell ismerged?

Yours

 

Bonjour,

 

Est-il possible de tester si une cellule est fusionner?

 

Bien à vous

what is wrong? with ID script ,auto change image size use photoshop?

$
0
0

I get this scrip from somebody,It is used to auto get the imagesize in Indesign,Open in ps.

here the image size is touch with  "Direct Selection Tool",then we see the ture width.

 

but,here, I would like to get the “”true width +12mm“”,

the bug is coming,some time It is right.the size is right.

but some times,the size is small, It is not I need, not I hope。

 

Can you help me ?  (the script is under,save to js,please, the soft is ID CS6)

My E-mail:57400673@qq.com

Thank you very much



---------------------------------------------------------------------- ---------

Main();

function Main() {

          var image = app.selection[0].images[0];

          var imagePath = image.itemLink.filePath;

          var hScale = image.horizontalScale;

          var vScale = image.verticalScale;

          CreateBridgeTalkMessage();

 

          function CreateBridgeTalkMessage() {

                    var bt = new BridgeTalk();

                    bt.target = "photoshop";

                    bt.body = myResizeImage.toSource() + "('" + imagePath + "'," + hScale + "," + vScale + ");";

                    bt.send();

          }

}

 

function myResizeImage(imagePath, hScale, vScale) {

          var myFile = new File(imagePath);

          var myDoc = app.open(myFile);

    var  oh=myDoc.width.value * hScale *0.010;

    var ov=myDoc.height.value * vScale*0.010;

    var oh=oh+12.00;

    var ov=((ov*(oh+12.00))/oh);

          myDoc.resizeImage(oh,ov, 350);

}

Print Error?

$
0
0

I open a file, and I print, why the document will show have been modified?

And I try the other method, i open a file and export a file to pdf, the document will not show have been modified

question.jpg


Change specific link path across documents.

$
0
0

I'm writing a simple script to change the path for a number of links across multiple documents. I'm getting a 'filePath is a read only property' error for line 7, even though I'm not trying to rewrite it directly. Any help would be greatly appreciated. Thanks!

 

var myDocument = app.activeDocument;
var oldPath = "G:\\Users\\My PC\\Desktop\\";
var newPath = "G:\\Users\\My PC\\Desktop\\New Folder\\";for (a=0; a < myDocument.links.length; a++) {    var currentLink = myDocument.links[a];    var linkName = currentLink.name;    if (currentLink.filePath = oldPath) {        var myNewFile = new File(newPath + linkName);        currentLink.relink(myNewFile);        };    }; 

Script for randomly replacing characters with alternates for natural handdrawn look

$
0
0

I have been looking for a script for a comic book project. What I would like the script to do is to randomly find and change for example some of the "E"s to alternates in the font. Is that possible? Does anybody know if it exists? I’ve been looking quite hard - and no luck. Back in 2009 somebody was discussing something similar - but not quite what I am looking for.

 

Best regards from Denmark....

how to make own crop marks in indesign CS5

$
0
0

HaloMaster..
Iwant tomake ascripcropmarkownusejavascrip..
cropmarkstandardInDesignonly

 

1.jpg

butIwant toadd acolorbaritselfusingPDFFile
Ihaveadded ascrip

 

function myDisplayDialog(){

    var myDialog = app.dialogs.add({name:"CropMarks"});

    with(myDialog){

//---------------------yazh---------------------------------

with(dialogColumns.add()){

            var myColorBarGroup = enablingGroups.add({staticLabel:"Color Bar", checkedState:true});

            with (myColorBarGroup){

                with(borderPanels.add()){

                    staticTexts.add({staticLabel:"Options:"});

                    with (dialogColumns.add()){

                          var myAllColorlesCheckbox = checkboxControls.add({staticLabel:"&All", checkedState:true});

                    var myTBColorCheckbox = checkboxControls.add({staticLabel:"&Top,Bottom", checkedState:false});

                    var myLRColorCheckbox = checkboxControls.add({staticLabel:"&Left,Right", checkedState:false});

                 }

                }

            }

        }

//---------------------yazh---------------------------------      

 

and..

 

var myReturn = myDialog.show();

    if (myReturn == true){

        //Get the values from the dialog box.

         //---------------------yazh---------------------------------   

        var myDoColorBar = myColorBarGroup.checkedState;

        var myColorBarAllColor = myColorBarGroup.checkedState;

        var myColorBarTBColor = myColorBarGroup.checkedState;

        var myColorBarLRColor = myColorBarGroup.checkedState;

         //---------------------yazh---------------------------------   

 

so thedisplay becomes

2 copy.jpg


getthemasterto helpmeadd ascripforcallinga PDFfileandadjustthearea,such as

3.jpg4.jpg


please help methemaster
I ama beginner..

 


Thank you

YazhiMyi

ID CC SUI - Insane Daft Crazy Cuckoo Stupid Useless Idiotic

$
0
0

Ok. I must admit the title might be a bit on the negative side but there's a reason for that.

 

In the 20 minutes or so that I have tried out some of SUI stuff on ID CC these are some of the problems I have come across.

There a a bunch more that I can't be bothered to type out just now.

 

1) The stacking order on Windows has changed to be the same as the Mac's -

myImage = ...... (geometricBound[x,x,x,x])

myStatic = ........(geo.. same as above)

The static overlays the image - great, except for the masses of script that are going to get messed up by that.

Like the day they will change from Left to Right Lane driving in England, nice idea but there's going to be a heck of a lot of funerals.

Have to check is Mac then ...  is Window then is version ..... I guess in another 25 years time thing will sort themselves out.

 

2) Horizontal Scrollbar gone, kaput, zap, pow disappeared of the face of the screen.

 

3) Vertical scrollbar, looks like the words in this threads titles.

 

4) See my beautiful scrollable panel function (don't forget to fix up the windows bug first) and see how rubbish it scrolls on CC - on CS6 and 5 looked great.

 

5) The unenabled icon button show's as the enabled one and some combination of both of them show when unenabled, it is really both fascinating and scary to think just how much time adobe must of spent testing things out

 

6) Image positions jump (a pixel) sometimes on clicking a radio button and sizes of panels have shrunk by just enough to make thinks look a mess.

 

7) Treeview, cut down like grass, see http://forums.adobe.com/thread/1235394?tstart=0 for other problems that Marc wrote there.

 

8) I set an editText graphic background color to null, on cs6 worked fine on "the new  more stable 64bit" indesign CC crashed within .001 of a second.

 

Well a least it did something quick.

 

I thought that I would wait some time before downloading indesign CC but when I saw the post on the treeview I decided to take a look.

 

Please add to the list.

 

P.s. Hi Peter, congrats on your new release of your excellent Grep book, good luck on your new release of the SUI guide (It's going to be a lot of work!!!)

Find and replace

$
0
0

Hi,

 

 

  XML poured document in InDesign, when moving the anchor it creates character like ":". 

 

I need to replace that character but I could not replace that. Even not able find that character in Indesign application manually.

 

 

 

char.png

 

find.png

 

 

 

 

If anyone knows, pls help me.

 

 

Thanks in advance,

Sudha K

Viewing all 15932 articles
Browse latest View live


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