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

Script to Change document measures and other size details to all open documents

$
0
0

Hi all

 

again in my work i need to change in severall files to specific measures type and size:

 

- in the "units and increments" preferences:

the inches to milimiters

and the cursor key increment

 

- i also need to change in document setup

 

width and height

and bleed size.

 

Would be a huge help if i would be able to change that in once to a set of open files... in my work i need to do that all the time... and i sure miss the "apply to all open documents"

 

thanks

 

Rui


Script for Increasing or decreasing page width

$
0
0

After the dialog open, based on selected value UI dialog box, there should be modification in indesign document. I want to move further. Please suggest me the script.

 

 

 

var myDialog = app.dialogs.add({name:"Adjusting Page Width",
canCancel:true});
with(myDialog){
//Add a dialog column.
with(dialogColumns.add()){    with(borderPanels.add()){
var myRadioButtonGroup=radiobuttonGroups.add();
with(myRadioButtonGroup){    var myNewmyPageButton=radiobuttonControls.add({staticLabel:"New Page", checkedState:true});    var myNewRectoButton=radiobuttonControls.add({staticLabel:"New Recto"});     var myChapterRunInButton=radiobuttonControls.add({staticLabel:"Chapter Run-in"});     }
 }
 with(borderPanels.add()){     with(dialogColumns.add()){         staticTexts.add({staticLabel: "Text width Increase by:"});         }     with(dialogColumns.add()){         var myPagewidthIncrease=dropdowns.add({stringList:["0 pt", "3 pt", "6 pt", "9 pt", "12 pt"], selectedIndex:0})         }     }    
with(borderPanels.add()){     with(dialogColumns.add()){         staticTexts.add({staticLabel: "Text width Decrease by:"});         }     with(dialogColumns.add()){         var myPagewidthIncrease=dropdowns.add({stringList:["0 pt", "3 pt", "6 pt", "9 pt", "12 pt"], selectedIndex:0})         }     }
 }
}
//Performing tasks for column values
varmyresult=myDialog.show();         

How not allow refresh Table when change cell?

$
0
0

I have a Table : 500 Cells.

If i update any attributes of Text in Cells. Table will auto refresh.

So process will very slow.

How not allow refresh Table when change cell?

Thanks All.

Find maximum value and apply cell style

$
0
0

How can we find and apply cell style to a maximum value in selected cells of a table in InDesign with the help of scripting?

change column width using 'FindChangebyList'

$
0
0

Hi - I use a .txt file (compiled using 'FindChange_Record.jsx') to perform a long list of Find/Change items.

 

I have the need to find and change certain paragraph text with varying 'column spans'.

 

While the GREP Find/change dialogue in InDesign will perform the task as a one off, once the search is saved to a 'FindChange_Record' .txt the changes aren't recorded. I've managed to edit manually the 'spanSplitColumnCount' figure and change from 2 and above spans, but I'm unable to find out how to change a paragraph of 'two column' span down to a 'single column/none' count.

 

Help required!

 

MTIA

 

(it did occur to me that I could probably add an extra paragraph style just for the purpose and then change back again afterwards - but I'm sure that there's a 'proper' way to do it).

 

Steve

Script to fit text inside Text box

$
0
0

Hi Guys, I'm new to in-design and need help for the below task :

 

I have a text box which i intend to use it for data merge...I want the content to fit inside the text box without the content being cut...i.e the text should automatically reduce the size and fit inside the text box when the content is big...Does anyone know a script to do this?

Scripts For indesign

$
0
0

Hello all.  I'm wondering if there is a script for indesign that allow me to put the file name/ and Color Identifiers at the bottom of the Document.  Also that will all me to place the information Where i want it.  For ex....   I want to Send a job to plates and rather than Manually entering the Filename - Date and time - and Colors on the Bottom of the Plate/FIle.  I know that when i go to export a file or print a file there is Check box to put the page information on the file and it does what i want however it put the information too far down on the Plate.  It adds the information down in the bend area of the plate and that does not get Burnt or Processed in that area.  I need a script to move the information up so we can read it. 

Selectable text from an alert dialog?

$
0
0

Javascript InDesign CS3 on a Mac, if that matters.

 

I took a quick look through the ScriptUI docs and couldn't find a widget for this, but maybe I missed it.

 

I'd like to display some alert text from a script and have the text in the alert dialog be cut-and-pasteable by the user. Is there an easy way to do this?

 

I'd really rather not have the text be editable-in-the-dialog by the user (looks ugly), and I'm absolutely happy with the quick-and-dirty interface of alert() -- that is, just passing a long string with internal newlines, and not having to spend much time mucking around with ScriptUI and dialog properties and layouts and layout managers, etc., etc.

 

Anyhow, is there a good way to do this? (I suppose I could pop up a dialog using AppleScript, but that really seems like the wrong answer...)

 

Thanks.


importXML not working

$
0
0

I have a test import working when i explicitly open a template and import...

 

var newDoc = app.documents.add();//open(File(TEMPLATE_EXTENSION));

newDoc.importXML(File(XML_EXTENSION));

 

yet when I open up a new doc and try to open up the same xml at the active one, nothing happens...

 

var doc = app.activeDocument;

doc.importXML(File(XML_EXTENSION));

 

The xml is imported just fine when done through the file menu. I've played around with xmlViewPreferences and xmlImportPreferences but can't get it to work. I just want it to show up in the side panel with the tags available to be used.

Column to Index

$
0
0

Hi to all,

I am pretty new to the world of scripting, and trying to learn more. I try to write some scripts to help me speed up some of my tasks, and all is going well, until today.

My current project requires creating an Index for a catalog. The project contains many tables of products/descriptions (some of which span a few pages long).

I'm trying to write a script that would add all first column cells contents (minus the first row as it is a header title) to the index, along with page reference; also add a reference marker to the source cells/contents.

 

Here is my current script so far, which results in an Error Number 24 (Object is not a function) at Line 5.

 

addToIndex();
function addToIndex(){    var myDoc = app.selection[0].tables[0].columns[0];    for (var i=1; i < myDoc.cells.length; i++){        app.activeDocument.indexes[0].topics.add(myDoc.cells(i).contents).pageReferences.add(myDoc.cells(i).texts[0].insertionPoints[0]);    }
}

 

Any help will be greatly appreciated.

 

Adham

Paragraph search

$
0
0

Is this possible to find the frist instance of paragapah in every page.

How to get the content of another file and paste into the active document in the place of certain string?

$
0
0

I'm newbie in indesign scripting stuffs.So I apologise as I couldn't post my trials.

Objective:
I have an indd document which will have figure caption,label etc. I need to copy content(figure which is editable) from other indd file to this document where related figure label exists.

For example:
sample.indd

Some text Fig.1.1 caption some text 

I need to copy the content of figure1.indd and paste into the sample.indd document where Fig.1.1string exists and so on. Now I'm doing it manually. But am supposed to automate this.

So, I need some hint how to acheive it using extendscript?

I have found something like below to do this, but I don't have any clue to develop it further and also am not sure whether this approach is correct to get my result. Pls help me

myDocument=app.open(File("file.indd"),false); //opening a file to get the content without showing.

myDocument.pages.item(0).textFrames.item(0).contents="some text"; //here I could set the content but I don't knw how to get the content

// ?????? Then I have to paste the content into active document.

Merging xml nodes

$
0
0

Hi all,

 

I am inheriting XML files where carriage returns create redundant nodes. That is to say that what should be :

 

<tag>A

B

C

D

</tag>

 

is actually

 

<tag>A</tag>

<tag>B</tag>

<tag>C</tag>

<tag>D</tag>


I can certainly look for these tags and do the merging somehow but I wanted to double check if there could be any generic way of merging those kind of repeated nodes. Unfortunately XPath implementation won't allow me to use something like following-siblings::tag


Any idea ?


Loic

about dublicate help this script

$
0
0

why this command is constantly working

I'm making a big mistake

 

my pages a specific object style applied to text frames

This text frames copy a new page

from top to bottom at defined intervals

I want to create

 

 

 

var ic = 0;

for (var p = 0; p < app.activeDocument.allPageItems.length; p++)

    {

        var mPageItems = app.activeDocument.allPageItems;

        for (var p = 0; p < mPageItems.length; p++) {

        var pageItem = mPageItems[p];

        pageItem.select();

 

 

if(pageItem.appliedObjectStyle == myCA){

            //pageItem.geometricBounds = [10,10,20,20];

            pageItem.duplicate(myDoc.pages[-1]);

            pageItem.move([0, 0 + (++ic)]);

}

}

}

Is it possible to build an index with IndexMatic pulling 2 character styles (such as code number and price)?

$
0
0

I have been using IndexMaticPro to build an index for a product catalog. So far we've just done a very simple index showing the product code number and the corresponding page numbers. I've been using the character style feature to do this, as I am just a beginner with script coding (I've learned a little GREP and use it within paragraph styles, but that's about it).

 

Now I want to be able to grab the code number character style and the price character style and show both on the same line in the resulting index. It seems like that should be possible. When I create a Style Group and choose that in IndexMaticPro, I still get only the code. Is there are way to make it pull ALL styles from a group instead of any style in that group?

 

Or do I need to learn more coding in order to write a custom query?


Anyone extend (or patch) Extendables?

$
0
0

At last check, I saw there are 39 forks of Extendables, excluding mine.

 

https://github.com/debrouwere/Extendables

 

Besides the pull requests to the original project, I'm wondering if any has made other changes to their fork (enhancements, bug fixes, etc.). And/or what other issues others have encountered wiht Extendables, since the source project currently has no issue tracker.

 

I'm just interesting in seeing the work others have done and collaborating, etc. since the source project isn't (actively) maintained.

 

I wish Github made it easier to diff/browse forks to see what changed from the source project. I haven't found out how to do it easily across 39 forks and Github is always slow to load fork detail info.

[JS] Modification XML en E4X

$
0
0

Hello, I would like to change the text " 888-555-2121 " as a selection with the value of the attribute but I does not succeed

Here is a test code:


var customer = <customer>

    <phone type="mobile">888-555-1212</phone>

    <phone type="office">888-555-2121</phone>

    <preferred>mobile</preferred>

</customer> ;

 

 

$.writeln (customer.phone.(@type == "office"));

 

I would like to put " 666-333-4215 " instead " 888-555-2121 " by selecting the item "phone" with its attribute " type == 'office' "

Je voudrais avec mettre "666-333-4215" à la place "888-555-2121" en sélectionnant l'élément "phone" grâce à son attribut "Type =='office'"

 

thank you a lot

Remove unused Styles using actions

$
0
0

Hi,

 

   I need to delete unused paragraph styles in document using action, until selection of unused style count is 0. 

   I saw  the below url in this forum.  Can i do this using action???

 

remove unused styles in one action...

 

Thanks in advance,

Sudha K

ScriptUI: textselection for edittext in InDesign CC 2014

$
0
0

Hello!

 

Can anyone confirm that »textselection« for »edittext« no longer works for InDesign CC 2014?

My system: Mac OS 10.9.5 and Indesign CC 2014.2


What about Windows or CC 2015?

 

 

#targetengine "textselection";

var _ui = new Window ("palette");
var _edittext = _ui.add ("edittext", undefined, "Please select this text!");
var _showButton = _ui.add ("button", undefined, "Show selected text");
var _exitButton = _ui.add ("button", undefined, "Cancel");

_showButton.onClick = function ()  {  alert(_edittext.textselection);
}
_exitButton.onClick = function ()  {  _ui.close();
}

_ui.show ( );

 

 

Roland

Remove empty charcaterStyleGroups

$
0
0

Dear scripters,

 

I'm trying to delete empty charcaterStyleGroups but I really don't know how.

 

This is what I have so far.

var doc = app.activeDocument;
var charcaterstyles = doc.charcaterStyleGroups;
for(var i=0;i<charcaterstyles.length;i++)
{  if(charcaterstyles[i].();  {        charcaterstyles[i].remove()      }
}

Greetings

Viewing all 8771 articles
Browse latest View live


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