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

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


Indesign autosave

$
0
0

I believe there's some autosaving and backup feature in Indesign, where to turn off this option or rather set to a longer time..

My Indesign will get slow at some time interval.

 

Heeeeellllp..

Font Converter .ps to .otf

$
0
0

Hi ALL,

 

Any font converter or any solution from postscript fonts(.ps)  to open type fonts(.otf).

 

 

Font i want to convert is "SassoCPMPri"

 

 

Can anyone give solution for this.

 

 

Regards

BEGINNER

File extensions on Mac

$
0
0

Hi there,

 

Using a line like this on a Windows machine:

 

     myFile= File.saveDialog("Save Settings", "Super script extension:

*.sse");

 

this makes sure that whatever name the user chooses for their file, the

correct .ccpp extension will be added.

 

From the documentation, it looks like the Mac will ignore the second

string in the brackets.

 

If this is so, how would you open save dialog on a Mac and make sure the

file gets saved with the correct extension?

 

Many thanks,

Ariel

 

[JS][CS5] automate numbering swatches?

$
0
0

Hey,

I'm trying to make a script that will automatically number swatches based on their order in the swatch panel.

 

I found this script in another topic already

 

var myDocument = app.activeDocument;for(i = 4; i<myDocument.swatches.length; i++){     if(myDocument.swatches.item(i).getElements()[0].constructor.name==='Tint'){         continue;     }     var mySwatchName = myDocument.swatches.item(i).name;     myDocument.swatches.item(i).name = ".XX." + mySwatchName;}
var nos = myDocument.swatches.length - 4;
alert("DONE and " + nos + " swatches renamed");

 

and that will rename everything with a .XX. in front of it.  However, I need the X's to be numbers starting at .01. and increasing from there.  I can't find out how to do this in javascript, can anyone help me out?

 

Thanks in advance.

InDesign 7.0 breaks Visual Basic reference

$
0
0

I've previously posted this to the Indesign SDK & Scripting forums, but haven't gotten a reply.
I thought I'd try again, rephrasing it a bit.
When I installed Creative Suite 4, InDesign 6.0 installed a COM typelib for Visual Basic.
C:\ProgramData\Adobe\InDesign\Version 6.0\en_US\Scripting Support\6.0\Resources for Visual Basic.tlb

I am able to reference this from VB.NET Visual Studio 2010 and program against the InDesign scritping API like a charm - with full IntelliSense.

With Creative Suite 5 InDesign 7.0 I am unable to establish this reference from Visual Studio.
Visual Studio can't find the reference.

Any ideas?

How do I print specific spot color(s) in separations?

$
0
0

I am still a beginner to ExtendScript & JavaScript, but I am learning fast. Right now, I need to figure out how to tell InDesign to print specific pages of the active document using a printer preset and—here's the kicker—only using certain spot colors.  (The preset already enables separations.)

Now I have followed both the Adobe InDesign CS6 JavaScript Scripting Guide on pages 47–51 as well as Jongware's guide on the subject. However, both only refer to turning on or off the Cyan, Magenta, Yellow, and/or Black channels (using the methods .printCyan, .printMagenta, etc.); there is no mention of doing so for any spot colors that exist in the document.

When using the Print dialog normally, you just select the Output tab and click the little printer boxes (basically checkboxes) next to each color separation that you want printed. Surely this can be replicated in ExtendScript, but how?

Move xml element into Lib Item

$
0
0

Hi,

 

I'm currently trying to build a script to move a ELEMENT  into anchored objects with a specific object style.

 

Here's my Script

 

myXMLElements = myGetXMLElements("//div[@class='boxed-text']");

---

---

***

---

myAnchorFrame = myLib.assets.item("Box").placeAsset(myElement.insertionPoints[0])[0];

//    myAnchorFrame = myLib.assets.item("Box").placeAsset(myXMLElements[i].insertionPoints[ 0])[0];

 

 

    myElement.move(LocationOptions.after, myAnchorFrame.textFrames[0].insertionPoints[0]);

 

ERROR: The element can not moved to the destination

 

any idea.

 

Hurix


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.

How to write data at the end of doc in reverse order?[CS6-jsx]

$
0
0

I need to move all my spec texts entries at et end of doc. To keep correct reference in all found entries i have to process in reverse order

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

 

...etc

 

but can't to think up, how to place entries in write order at the end.

 

String:

mStory.insertionPoints.item(-1).select();

app.paste();

 

does not work properly (of course). It makes this:

 

10.

9.

8.

7.

6.

...etc

How to get

1.

2.

3.

4.

...etc

?

XML ATTRIBUTE

$
0
0

Hi,

 

xml data with contains attribute values.

 

XML Data:

 

<chapter>

<div class="figure" id="s9781452281988.n9.i73">

<p class="fig-caption" name="Figure 9.2.">Prevention of, and Treatment for, Mental Health, Substance Abuse, and Family Conflict</p>

<img src="10.4135_9781452281988-fig0902.jpg" alt="Figure 9.2. Prevention of, and Treatment for, Mental Health, Substance Abuse, and Family Conflict"/>

</div>

</chapter>

 

JavaScript:

 

var myDoc = app.activeDocument;

var myGlueCodePath = app.filePath + "/Scripts/XML Rules/glue code.jsx";

var myFile = File(myGlueCodePath);

app.doScript(myFile);

if (app.documents.length != 0) {

    var myRuleSet = new Array(

new findObjAttribute("//*")

);

    with(myDoc) {

        var elements = xmlElements;

        __processRuleSet(elements.item(0), myRuleSet);

        }

    }

 

else{

alert("You have no document open!");

exit();

}

 

 

function findObjAttribute(){

this.name = "findObjAttribute";

this.xpath = ("//div[@class='figure']//p[@class='fig-caption']");

this.apply = function(myElement, myRuleProcessor)

{

var elmName=myElement.markupTag.name;

with(myElement){

try {

var myAttName=myElement.xmlAttributes.itemByName("name").value;

$.writeln(myAttName);

}catch(e){};

}

}

}

 

 

my Problem is After import xml in to InDesign i will get output like:

 

Prevention of, and Treatment for, Mental Health, Substance Abuse, and Family Conflict

 

But am expecting with attribute name following contents

 

Figure 9.2 Prevention of, and Treatment for, Mental Health, Substance Abuse, and Family Conflict

 

can any one modify my Script

 

Hurix

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

Help! new to script

$
0
0

hi forum!......

 

I m new to scripting...

 

I want a small things to do with scripting.

 

 

I want to select an image (link) placed inside page(0) of document.

 

my link name. teddy_1.ai. and the location is in desktop (PC);

 

so....

 

app.select("~/Desktop/teddy_1.ai");

 

sorry i'm just tring....

 

pls help me forum.....

 

THANKS,

FST...

Adding row at a table in indesign CS6 from javascript

$
0
0

I have a table in my indesign page.It has one column and several rows. I want to add a row at the begining of the table  and add some text content to it.

I tried some provided code but none have worked.

This is how i reference the table object.

 

var mytable =myPage.textFrames.item(0).tables.item(0);

I tried each the following but none worked and gave an error

 

   mytable.rows[0].cells[0].insertionPoints[0].contents =  "TEST TEST";

                                                  

   mytable.rows.add( LocationOptions.AFTER, mytable.rows[-1] );

                                                 

   mytable.rows.add( LocationOptions.Before, mytable.rows[0] );

 

What should i do?

Folder action to package and create pdf Applescript folder action

$
0
0

Hi

Does anyone have an Applescript Folder Action to package Indesign CS5.5 files and make pdfs.

Thanks, in advance.


[JS] ScriptUI CS6

$
0
0

Hi

 

Can anyone help me with a bit of ScriptUI. I am building a dialog box that contains a tabbed panel containing a single tab. I am filling this window with rows of editText boxes. Is it possible to make the tabed panel scrollable? There will be times when the screen is not deep enough, and need to be able to scroll up and down.

Screen Shot 2013-06-10 at 11.44.16 PM.png

Cheers

 

Roy

ExtendScript libraries

$
0
0

Hello All,

 

I want to create a library of commonly used functions, etc. that I can use in my ExtendScript scripts. I created a script that I put in the JavaScript startup folder that has this content:

 

var CPF = {};

CPF.getText = function () {
        var text = "";    return {        getText: function (textObj) {            // Get a list of strings in the text object.            var textItems = textObj.GetText(Constants.FTI_String);            // Concatenate the strings.            for (var i = 0; i < textItems.len; i += 1) {                text += (textItems[i].sdata);            }        }    };
}

 

Now when I want to get the text of a text object, I can use this:

 

alert (CPF.getText(pgf)); // pgf is a paragraph.

 

One important note: I am using ExtendScript with FrameMaker here, not InDesign, so the code itself may look unfamiliar. I am posting here because the principles should be the same in InDesign and there are a lot of smart people here :-). I have been looking at JavaScript libraries and reading about good design patterns, but I am having a hard time translating this to the ExtendScript environment.

 

My questions are: Is this the best way to do this kind of thing? Or, is there a better way to have a library of functions that can be used in my scripts? Thanks in advance.

 

Rick

[CS5.5][JS] How to get anchored object by text search result?

$
0
0

Hi,

 

I need to get the anchored object by text search result. This can be an image, textframe, grouped objects...

 

This is my code...

 

 

            app.findTextPreferences = NothingEnum.nothing;

            app.findTextPreferences.findWhat = "<FFFC>";

 

 

            var myResults = app.activeDocument.findText();

           

            var currentParagrapfNum = -1;

           

            for (var n = 0; n < myResults.length; n++){

               

                        var currentResult = myResults[n];

                       

                        currentParagrapfNum  = currentResult.paragraphs[0].index;

 

                        var currentAnchoredObject = ??? ;

 

                        currentAnchoredObject.anchoredObjectSettings.horizontalReferencePoint = AnchoredRelativeTo.TEXT_FRAME;

                        currentAnchoredObject.anchoredObjectSettings.verticalReferencePoint = VerticallyRelativeTo.LINE_BASELINE

 

            }

 

Can someone please help me?

 

Thanx

[CS4/5][JS] Script causes InDesign to crash

$
0
0

Hello,

 

I'm having a bit of an issue with some InDesign scripting i'm working on, and wonder if anyone else has had the same issue.

 

I have a script that uses app.dialog to prompt for user information.  It then takes the result of that dialog, and uses it in the script.  Pretty standard so far, and if i run this from the scripts panel, or from ESTK, it works fine.  If I set it up as a Script Menu Action, when I run the script via the menu, it executes, then crashes InDesign.

 

I have tried this with multiple dialog's, and each time a dialog is called from a SMA, InDesign crashes.  The following code is fairly pointless, but will cause InDesign to crash when the SMA is run.

 

/******************************************************/////failTest.jsx//Test script will cause InDesign to crash when the SMA is invoked//Daniel Cole//Wed Jun 09 2010 13:26:47 GMT-0400///******************************************************/ 
#targetengine "session" //set up the SMA and eventListener
var saTest = app.scriptMenuActions.add("Test SMA");
var elTest = saTest.eventListeners.add("onInvoke", function()     {          alert(testFunc());     }); //Check for the menu, and create it if it doesn't existtry{    var menuTest = app.menus.item("$ID/Main").submenus.item("Test");    menuTest.title;}catch (e){    var menuTest = app.menus.item("$ID/Main").submenus.add("Test");} 
menuTest.menuItems.add(saTest) //test function//creates a dialog box with a text edit box//returns the content of the text edit box
function testFunc(){     testDialog = app.dialogs.add({name:"Enter Text:", canCancel:true});          with(testDialog){               with(dialogColumns.add()){                    var getTextField = textEditboxes.add({editContents: "Test Text", minWidth:250});               }          }     testResult = testDialog.show()     if(testResult == true){          var testText = getTextField.editContents;          testDialog.destroy();          return testText;     }     else{          return"No Text Entered";          myFileDialog.destroy();     }}

 

I've tried this on CS4 and CS5, on multiple installs, and it crashes every time.  Can anyone else replicate this?  Is this a known issue?  Is there any way to work around it?

 

thanks,

 

Daniel Cole
Electronic Prepress and Automation Specialist
Disc Makers

Which .dll contains the Splash Screen?

$
0
0

Hey gang,

 

Do any of you know which .dll file within Adobe InDesign CS6 contains the startup splash png image file?

 

Best,

 

Mike Witherell, ACE

Viewing all 15932 articles
Browse latest View live


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