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

Trusted Source

$
0
0
I need to execute a JavaScript outside of the scripts panel, triggered by another process. Each time I run the script, I receive the message:
>You are about to run a script in InDesign CS3. You should only run scripts from a trusted source. Do you want to run the script? [yes/no]

Where is a "trusted source" in Windows so I can run scripts without this manual click-through alert?

I've tried dropping it in ..\Adobe InDesign CS3\Scripts\ and ..\Scripts Panel\ directories, but that doesn't work. I note that there's a trusted location for Photoshop scripts: C:\Documents and Settings\Administrator\My Documents\Adobe Scripts (refer to http://www.adobeforums.com/webx/.59b55b6d), but this does not work for InDesign scripts. Any ideas?

Get coordinates of path of a text selection

$
0
0

Hi,

 

I want to get the coordinates of the path of the selection made on some text content. Is that possible?

 

Thanks!

How I can create scrollable table in indesign interactive pdf?

$
0
0

Hello Everyone,

                        I want to create scrollable table in indesign interactive pdf .I am trying to create table dynamically and render data on the table using xml but when xml data is more and more then content going out of document and it is not visible when i export document as interactive pdf. Can anyone help me to create scrollable table in interactive pdf using jsx script.

 

 

Thanks

Rahul

Cell style script not working in CS6

$
0
0

I picked up the following script from the forum that is supposed to apply cell styles that I created to various cells.

01.var myTable = app.activeDocument.stories.everyItem().tables;
02. for (var n=0; n < myTable.length; n++){
03.//~ myTable[n].appliedTableStyle = “NewTable”;
04.//~ myTable[n].cells.everyItem().appliedCellStyle = app.activeDocument.cellStyles.item(“[None]“);
05.//~ myTable[n].cells.everyItem().clearCellStyleOverrides (true);
06.
07.// Please check the table cell styles name is correct or not?
08. var myActiveTable = myTable[n];
09. myActiveTable.rows.itemByRange(0,-2).cells.everyItem().appliedCellStyle = “TTable_AA_Tint”;
10. myActiveTable.rows[0].cells.everyItem().appliedCellStyle = “Table_Title”;//First Row
11. myActiveTable.rows.itemByRange(-2,-1).cells.everyItem().appliedCellStyle = “Table_AA_Tint”;//Last Row
12. }

 

 

Whenever I run the script, I get the following message. Can someone please tell me what I need to change or fix? Any feedback would be highly appreciated

JavaScript Error!
Error Numnber:25
Error String: Expected:;

Engine:main
File C:\Program Files (x86)\Adobe\Adobe InDesign CS6\Scripts\Scripts Panel\AutoFormatTablesWithCellStyles.jsx
Line:2
Source: 01.var myTable=
app.activeDocument.stories.everyItem().tables;
Offending Text:myTable

correct my script 'clear empty enter mark'

$
0
0

Hi,

 

My script is working for remove extra enter mark in Indesign file, but when its removed that time the enter mark followed para style is changed.

I want to remove the enter mark at the same time I have retained followed para style. Is this possible by script?

 

This is my code for remove empty enter marks:

 

app.findGrepPreferences=NothingEnum.nothing;

app.changeGrepPreferences=NothingEnum.nothing;

app.findGrepPreferences.findWhat = "~b~b+";

app.changeGrepPreferences.changeTo ="\r";

app.activeDocument.changeGrep ();

 

 

See my snapshot below:

Remove empty enter mark .png

 

If I removed the empty enter mark by above script, empty enter mark(Normal) followed  'ABS_H' style was removed and empty enter mark style 'Normal' was applied to 'ABS_H'. Here I want retain the ABS_H style. Is this possible by script? Pls help me.

 

 

by

hasvi

How to find top level object on a given layer?

$
0
0

I need to assign it to a var...

 

var topLevelObj = app.activeDocument.layers.name("foo")... whatever is on top of that stack...

 

...this is probably not correct but you know what I mean

Indesign (IDML file) Viewer using HTML5 and Javascript

$
0
0

I’m working on IDML file automation. My requirement is to showcase an IDML template in an HTML5 editor.

I have a simple TextFrame with Hello World text. I saved the file as: sample.idml. Then, I unzipped sample.idml and got a few files. Went to the stories folder and opened: story_d8.xml.

Since I’m a developer, I did this using Java and exposed the file path as a REST call. The biggest stopping point is: the jQuery/AngularJS script is saying:invalid file.

Can someone suggest options to address the points below:

  1. Get Content data using JavaScript (jQuery/AngularJS)
  2. Put "Demo Hello" in the Content and regenerate story_d8.xml (using JavaScript)
  3. Is this the correct approach? Are there alternative to this approach?

Note: My Requirement is to modifying IDML file at client side (javascript) only.

Create circles inside the corners of page bounds

$
0
0

First off, I am crap at scripts. When looking through the Adobe scripting guide I eventually drop into a fugue state. Attempts to write my own and reverse engineer other scripts have resulted in too many errors to mention. So I figure I am better off asking the community.

 

I need to create three 100% black circles at the top right, bottom right, and bottom left corners; at 1/2 inch inside the PAGE bounds.

 

These are used as fiducial markers for the flatbed printer our production team uses to align the printing and router.

 

One solution is to draw the circle/ellipse/oval using the page coordinates. however I'm not sure how to specify this since the page size will vary from document to document.

 

The other option would be to mimic the crop marks script and apply the circle to a box drawn on the page.

 

Has anyone seen a similar script?

 

Thanks for any help.


Canvas support in Indesign scripts?

$
0
0

Hi there,

 

short version:

I was wondering if it is possible in any way to include auto generated raster content (Using canvas api for example) in in-design using JavaScript?

 

Long version:

I noticed that In-design supports a very old version of JavaScript, and since I'm pretty new to InDesign scripting I thought it's better to get informed about its capability / limitations before planing about what to do with it! I wrote a Javascript code (not in in-design script) that generates unique random patterns of motifs, now I'm interested if I can integrate it in in-design scripts so it would put one of this raster images in each page of an in-design document (IE: left and right side of each relatively facing pages);

also since my first guess after studying a bit In-design's object-model documentation was that it is very much limited to just what is possible through the software UI itself (and not any/some thing new/more), then I was wondering (in that case) how much is it possible to hook an script to an external script, and sending and receiving data/vars between them; like putting both scripts in the same folder, the first one calls the other one giving it some info (document dimensions, etc.), the second script runs (outside of ID), put the images on disk and return to main script when it's done!! :/

I have some other solution sketches as well in my mind, but wanted to have your input before doing anything ridiculous!! :-)))

 

 

I really appreciate your in-put on this,

thx, mim,

Refresh File.length

$
0
0

Hello,

in ExtendScript when I store a File object in a var like:

 

var f = new File("~/Desktop/temp.jpg");

 

I can check for properties such as the filesize:

 

f.length

 

If the filesize changes after the variable has been declared and the value assigned, f.length doesn't reflect the correct number - I can understand the why.

 

Since I need to dynamically test the filesize against a reference value in a function, I've been doing this way - which looks to my eyes a bit clumsy:

 

function reduceToSize (fileObject, fileSize) {    while(File(fileObject.fsName).length > fileSize) {        // do stuff to reduce the file size    }
}

 

This way I ensure that the reading is always up to date.

I wonder whether this is the best/only way to have a live-updated reference of the file size (or any other File property).

Thank you in advance for your comments,

 

Davide Barranca

---

www.davidebarranca.com

www.cs-extensions.com

How to make this script work

$
0
0

Help me to make this script work, please!

 

 

function(){

app.findGrepPreferences.firstLineIndent  = "8 mm";

app.findGrepPreferences.leftIndent  = "8 mm";

app.changeGrepPreferences.firstLineIndent  = "8 mm";

app.changeGrepPreferences.leftIndent  = "16 mm";

app.selection[0].changeGrep();

 

app.findGrepPreferences.leftIndent  = "16 mm";

app.changeGrepPreferences.leftIndent  = "24 mm";

app.selection[0].changeGrep();

 

}

Exporting different images to jpg (with different names)

$
0
0

Dear Scripters,

I KNOW I can script all this, but I need your help to find my way home…

 

I have a doc made of 15 pages, each of these contains three or four instances of the same image, in different dimensions (iPhone, iPad, Android, Web, etc.).

 

I prepared the pages assigning a different ScriptLabel to each instance, like:

 

Page 1

p1_HW

p1_HMT

p1_HNMT

p1_lightbox

 

Page 2

p2_HW

p2_HMT

p2_HNMT

p2_lightbox

 

and so on.

 

I'd like to export automatically each instance as a jpg, naming it by its ScriptLabel.

BTW, is it possible to filter processing of the instances depending on what's AFTER the first underscore of the ScriptLabel?

 

Just, if you can, give me some rough directions on what's the best way to approach the script, then I'll try to figure out myself…

g

KeyTerm pickup

$
0
0

Dear Friends,

 

I need keyterm definition placed in stub column

 

My requirement is:

1. Multiple keyterms placed in one box

2. Each keytem placed in each box

 

Input file:

Screen Shot 2014-05-22 at 4.36.41 PM.png

My Requirements:

 

1. Multiple Keyterm definition placed in one box


Screen Shot 2014-05-22 at 4.34.03 PM.png



Screen Shot 2014-05-22 at 4.51.17 PM.png


This is urget requiremnt kindly help me.


Thanks

kanaga kumar. k

 


 











Copy tables from one document to another in indd cs6

$
0
0


hi,

 

I have two documents different content but same page numbers, trim size and margin etc.

 

Once the main document is final, there are few tables from page 5 to page 20 (one table on each page) which exactly goes in anther document (same page and same xy co-ordinates).

 

Need script for this.

 

As every table is present in text frame so i can easily assign variable to that text frame.

var myTable1 = myDoc.pageItems.itemByID(111076);  //page 5 table

var myTable2 = myDoc.pageItems.itemByID(111080);  //page 6 table  etc.

 

Thanks

virender

 

Note: there are other text frame on pages which have tables.

Use a Radio button like a check box.

$
0
0

Something I was playing around with. I think the radio buttons look better than the check boxes.

 

var button900=radioSize.add("radiobutton",undefined,"Press For 900 book size");      radioSize.children[0].value = false;
var mouseEventHandler = function(ev){    radioSize.children[0].value = false;
};    button900.addEventListener('click', mouseEventHandler);    
@

Javascript lint

$
0
0

I have been looking for a program that might help me with my InDesign and Acrobat Javascript syntax and I stumbled across a Javascript Lint program.  As far as I can tell its public domain software and it looks like it would be exactly the kind of help I need.  Has anyone else tried it?  Is it worth anything?

 

Please feel free to leave a frank and honest response to this question.

 

R,

John

How to discover text objects with specific point size

$
0
0

Can I somehow narrow down the selection to point size xx and smaller? I'd like to outline those objects later.

 

var alltxtObjsBelow10 =  app.activeDocument.stories.everyItem() //...with point size smaller than 10pts
alltxtObjsBelow10.createOutlines();

Please correct my condition

$
0
0

Hi,

 

I have written the statement like below:

 

if((globBaseLineDiff!=0) && (myTextWrap.textWrapPreferences.textWrapMode = TextWrapModes.JUMP_OBJECT_TEXT_WRAP))

 

Its working fine, but need to add more condition that as like:

 

if((globBaseLineDiff!=0) && (myTextWrap.textWrapPreferences.textWrapMode = TextWrapModes.JUMP_OBJECT_TEXT_WRAP && BOUNDING_BOX_TEXT_WRAP))

but its not working any help for this?

 

 

by

hasvi

Text wrap bottom offset-by script

$
0
0

Hi

 

 

How to increase my 'text wrap bottom offset' values by script?

 

 

by

hasvi

How to insert "Anchroed Object"

$
0
0

I need to find the all 'italic' words in my Indesign file by using below code:

 

 

app.findTextPreferences.appliedCharacterStyle= "Italic";

 

 

Now I want to insert the 'Anchore Object' before the Italic word, that anchore object width must be match with italic word width, and it that anchored box should be placed on italic words, is this possible by script?

FYI as like below:

1.png

 

 

by

hasvi

Viewing all 8771 articles
Browse latest View live


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