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

node.js in CEP6 - which version?


Export selected pages to pdf

$
0
0

Is there an solution to automatically fill out the number of selected pages from the page palette to the export dialog? I often export only few selected pages of the document as a PDF alone and have to list them.

Adding a New Menu option in Indesign and running a script once clicked.

$
0
0

Hi All Me again. Sorry.

 

I'm trying to add a script to indesign - nothing seems to be working and I'm no good at code.

 

The name I want to call the menu is EXPORT PDF

 

and the script which finally works is:

 

 

d = app.activeDocument;

// Here you can choose the PDF preset

preset1 = app.pdfExportPresets.item ('Print1');

preset2 = app.pdfExportPresets.item ('Lowres');

if (!(preset1.isValid && preset2.isValid)){

alert("One of the presets does not exist. Please check spelling carefully.");

exit();

}

if (d.saved){

thePath = String(d.fullName).replace(/\..+$/, "") + ".pdf";

thePath = String(new File(thePath).saveDlg());

}

else{

thePath = String((new File).saveDlg());

}

thePath = thePath.replace(/\.pdf$/, "");

name1 = thePath + "LR.pdf";

name2 = thePath + "HR.pdf";

d.exportFile(ExportFormat.PDF_TYPE, new File(name1), false, preset1);

d.exportFile(ExportFormat.PDF_TYPE, new File(name2), false, preset2);

 

Can anyone help with this. The PDF script is located in users but not sure about the beginning bit.

Many thanks

Rahul

how create Automatic page in indesign.

$
0
0

hi .

i have algoritm place multi text frame in page indesign . now , i want while file page then create new page and place text frame in new page . pleas help me .
code COM(C#) or Script

Finding the end of line

$
0
0

Is It possible to find and change a character in the end of each line from a block text?

I know Indesign GREP can't do this, GREP only finds the end of paragraph, not lines.

I understand this is a problem because every time the text frame is modified, you have another character being changed.

Is It possible to do this with a script?

I have attached an image of what I would like to do.

The text in the image is Hebrew (R2L language) and the end of line is in the left.

Any help would be great.

Sami

exemple.jpg

Folder.getFiles Multiple Filters Mask

$
0
0

Hi all,

 

Folder.getFiles (".*") ... in this case it will get all types of files

 

Folder.getFiles (".jpg") ... in this case it will get all files with .jpg extension

 

... but how can I filter to get (for example) all files with ".jpg", " .tif" or ".eps" extension ?

 

ESTK help says: A mask string can also be the name of a function that takes a File or Folder object as its argument. It is called for each file or folder found in the search; if it returns true, the object is added to the return array.

 

Any idea of how to make such a function?

 

I will appreciate any help.

Delete Unused Paragraph Styles

$
0
0
Hi All,

I realize this one is probably pretty easy, but it has given me some grief these last few minutes. I'm trying to delete all unused paragraph styles in a document in InDesign CS. Here's the latest on what I have:

tell application "InDesign CS" to delete every unused paragraph style of document 1

I can't even get it to compile that. I've tried several variations, but all had the same result...it does not seem to like where I placed the word "unused", but I can't seem to figure out any other correct syntax.

Any help is greatly appreciated!

Extendscript Toolkit

$
0
0

Bonjour,

 

Je ne voix pas où je pourrais posté cette discussion.

 

J'ai un problème avec "Extendiscript Toolkit", il fonctionne de manière saccader.

 

Quand j'encode rien ne se passe il est figé et d'un seul coup il commence à taper le texte, même chose pour le reste (sélections, etc.)

 

Je travail sur mac EL Capitan, j'avais déjà ce problème sur l’ancien système.

 

Ce phénomène est apparut avec la version CC.

 

    Avec-vous une solution?

 

Merci à vous


Hyperlinks ON pop-ups

$
0
0

I think I already know the answer to this because I've just tried it and it didn't work, but just wondering if it's possible to have a hyperlink to a URL ON a pop-up? So I'm creating pop-ups using the show/hide tool, can I then have a hyperlink on this pop-up? I'm thinking there could be a work around? Maybe not though...

 

Thanks!

Code optimise

$
0
0

Dear JS Lovers,

 

Can anyone optimise my code?

 

function place_pdf (myStory) {
var myRec = myStory.rectangles;
for(i=0; i<myRec.length; i++){
if(myRec[i].topLeftCornerOption == CornerOptions.ROUNDED_CORNER && 
myRec[i].topRightCornerOption == CornerOptions.ROUNDED_CORNER){
app.pdfPlacePreferences.pdfCrop = PDFCrop.CROP_TRIM;
app.pdfPlacePreferences.pageNumber = i+1;
app.pdfPlacePreferences.transparentBackground = true;
myRec[i].place(myPDF, false)
}
}
}

 

Kind Regards,

Sumit

ID CC 2014 plus ExtendScript (Yosemite) slow to the point of not working...

$
0
0

Hi all

Since upgrading to Yosemite ExtendScript is sooooo slow.

I literally watch the editor trying to keep up with me typing.

Anybody else having this issue?

Regards

Romano

AppleScript to JavaScript for InDesign Package

$
0
0

Hello,

 

I need your expert help in converting my AppleScritpt to JavaScript. I'm not a script writer but I have created this small script to create packages along with the PDFs and zip it all together.

 

Here's my AppleScript:

with timeout of 86400 seconds

   

    tell application "Adobe InDesign CS5"

       

        set myDocument to active document

        set docName to name of myDocument

        set sourceName to text 1 thru -6 of docName

        set sourcePath to the file path of myDocument as string

       

        tell application "Finder"

            set packFolder to make new folder at sourcePath with properties {name:sourceName & "_Package"}

        end tell

       

        tell active document

            save myDocument

           

            set PrintPDF to (packFolder as string) & sourceName & ".pdf" as string

            export format PDF type to PrintPDF using "KMMS_RRD_Print" without showing options

           

            set WebPDF to (packFolder as string) & sourceName & "-Web.pdf" as string

            export format PDF type to WebPDF using "KMMS_Web Ready" without showing options

           

            set idmlFile to (packFolder as string) & sourceName & ".idml"

            export myDocument format InDesign markup to file idmlFile

           

            package to alias (packFolder as string) copying fonts yes copying linked graphics yes including hidden layers yes copying profiles no updating graphics yes ignore preflight errors yes creating report no

           

            close myDocument

           

        end tell

    end tell

   

    --Creating a zip file of the package folder and deleting the folder

    tell application "Finder"

        set theItem to packFolder as alias

        set itemPath to quoted form of POSIX path of theItem

        --set fileName to name of theItem

        set theFolder to POSIX path of (container of theItem as alias)

        set zipFile to quoted form of (theFolder & sourceName & "_Package.zip")

        do shell script "cd " & itemPath & ";zip -r " & zipFile & " *"

    end tell

   

end timeout

document.search() is not a function

$
0
0

We recently upgraded from InDesign CS2 to InDesign CS6.

We have scripts that we ran on Windows InDesign CS2 that we are trying to get to run on a Mac InDesign CS6.

 

We are getting the following error when executing one of the scripts.

 

Screen Shot 2015-04-09 at 4.14.23 PM.png

 

 

I looked in the Object Model Viewer and did not find a method search() for Document.

 

Screen Shot 2015-04-09 at 4.06.16 PM.png

 

Since it looks like this worked before in CS2, I am wondering if anyone knows if this method was deprecated in CS6 and if there is another method that does the same work?

This is the code that gets executed.

Screen Shot 2015-04-09 at 4.06.27 PM.png

Any help in the right direction is appreciated.

help with changing language of docs at startup

$
0
0

Hi guys, I was hoping for a little help with a script to put in my startup folder - I want it to change the language of everything in the document to UK english.

 

 

This changes everything in tables to english:

  myDoc.stories.everyItem().tables.everyItem().    cells.everyItem().texts.everyItem().    appliedLanguage="English: UK"; 

I need it to change the language in all paragraph boxes/stories as well. not sure how to make this happen:

 

However when I put it in a startup script like this

#target indesign    
#targetengine "session"    
var      myEventListener = app.eventListeners.item("loadstyles");          if (!myEventListener.isValid) {      myEventListener = app.addEventListener( "afterOpen", doJob );      myEventListener.name = "loadstyles";      }        
function doJob() {     // Continue on with your code from here  myDoc.stories.everyItem().tables.everyItem().    cells.everyItem().texts.everyItem().    appliedLanguage="English: UK";  
}


It doesn't seem to do anything.
any help would be greatly appreciated..... bonus points if you can tell me how to uncheck hyphenation on everything in the document as well

get swatches in dropdown list with color preview...

$
0
0

Hi experts,

 

I am creating one gui for swatches related automation task in CS4 using javascript. Is it possible to get swatches in dropdown list with its color preview? Same like colors in Swatches palette.

 

Your help will be much appreciated. Thanks in advance.

 

Thiyagu


how to make startup script run only once

$
0
0

I have hacked together a startup script to change all the text and languages in my documents to UK english and remove all hyphenation.

 

It seems to work as intended except that it throws up this warning dialogue box every time I open a document:

"An attached script generated the following error:
Object does not support the property or method 'textDefaults'
Do you want to disable this even handler?"


I usually just click no and carry on but it's annoying so would like to fix it properly if possible.
I think what's happening is the script runs twice, once before the document is actually open (throws up the error) and then once again after the document is open.

 

I only need it to run once per document open, obviously.
Any ideas?

 

Here is the full script from my startup folder.

#target indesign 
#targetengine "session" 

var        myEventListener = app.eventListeners.item("loadstyles");  if (!myEventListener.isValid) {  myEventListener = app.addEventListener( "afterOpen", doJob );  myEventListener.name = "loadstyles";   }            

function doJob(evt) {
  if(app.documents.length == 0){    return;
}  var myDoc = evt.parent;  if( !myDoc instanceof Document) return;

try{
  myDoc.stories.everyItem().tables.everyItem().      cells.everyItem().texts.everyItem().       hyphenation = false;
}
catch(e){}

try{
  myDoc.stories.everyItem().texts.everyItem().       hyphenation = false;
}
catch(e){}

try{
  myDoc.stories.everyItem().tables.everyItem().      cells.everyItem().texts.everyItem().      appliedLanguage = "English: UK";  
}
catch(e){}

try{
  myDoc.stories.everyItem().texts.everyItem().      appliedLanguage = "English: UK";  
}
catch(e){}

with(myDoc.textDefaults){
try{
appliedLanguage = "English: UK";
}
catch(e){}
hyphenation = false;
}
}

Export selected pages to pdf

$
0
0

Is there an solution to automatically fill out the number of selected pages from the page palette to the export dialog? I often export only few selected pages of the document as a PDF alone and have to list them.

[JS] How to get folder count?

$
0
0

Hi.

 

I want to get a number of folders for a specific directory.

 

 

 

 

var folderCount = Folder("C:/test/file/").getFiles( ? );    // Is this what values need?

alert(folderCount.length);

 

 

 

 

If this method is wrong, please tell me the other way.

 

Thanks

CEP debugging with Chrome - strange window layout ..

$
0
0

Hi,

 

if you're working on CEP/HTML5 extension you may know that you can remote debug them in chrome by creating a .debug file - I used this a few times, worked always fine.

Now I'm trying again and I don't see the usual window layout. Everything is reduced to the top 20%, the bottom is clear:

windowlayout.png

Does somebody hat this problem too? Does remote debugging work for you at the moment with the latest versions of chrome?

 

Thanks

Klaus

Process Bar

$
0
0

w = new Window("dialog{\

orientation:column',\

alignChildren:'top',\

img:Image{\

size:[230,150]\

}\

}");

w.orientation = 'column';

w.img.icon = File("path/Logo Extraction.jpg"); 

pb = w.add('progressbar', [12, 24, 450, 36], 0, 100); 

w.show(); 

for (i = 0; i < 100; i++){ 

  pb.value = i; 

  w.update();   -----------------------------------------------------------  showing not implemented

  $.sleep(50); 

w.close(); 

Viewing all 15932 articles
Browse latest View live


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