Selecting Pantone in InDesign with script

I selecting a specific color of my document
Hey all !
I'm trying using Script:
var myDoc = app.activeDocument;
var midPage = myDoc.pages.middleItem();
var color = PANTONE 7490C;
to see if I can give Script code to get the result.
thank you very much hope to answer please.
Raul.

Hi Raul,
I also beginner only. Please try this below script may it helps you.
app.findTextPreferences = app.changeTextPreferences = null
app.findTextPreferences.fillColor = "PANTONE 100 UP"     //Insert your PANTONE 7490C
app.changeTextPreferences.fillColor = "GREEN"                 //Replace your needed color
app.activeDocument.changeText()
Thanks
BEGINNER

Similar Messages

  • How to place a word document in a TextFrame with InDesign CS2 scripting (JavaScript)?

    I´m newbie with InDesign CS2 Scripting (JavaScript). I need some help to understand the way to place a Word document in an indesign template, using JavaScript(.jsx).
    Thank you for the help,
    Peter

    //PlaceTextFileInFrame.jsx
    //An InDesign CS3 JavaScript
    //Places a text file in a text frame.
    var myDocument = app.documents.add();
    //Set the measurement units to points.
    myDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
    myDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
    //Create a text frame.
    var myTextFrame = myDocument.pages.item(0).textFrames.add({geometricBounds:myGetBounds(myDocument, myDocument.pages.item(0))});
    //Place a text file in the text frame.
    //Parameters for TextFrame.place():
    //File as File object,
    //[ShowingOptions as Boolean = False]
    //You'll have to fill in your own file path.
    myTextFrame.place(File("/c/test.txt"));
    function myGetBounds(myDocument, myPage){
    var myPageWidth = myDocument.documentPreferences.pageWidth;
    var myPageHeight = myDocument.documentPreferences.pageHeight
    if(myPage.side == PageSideOptions.leftHand){
    var myX2 = myPage.marginPreferences.left;
    var myX1 = myPage.marginPreferences.right;
    else{
    var myX1 = myPage.marginPreferences.left;
    var myX2 = myPage.marginPreferences.right;
    var myY1 = myPage.marginPreferences.top;
    var myX2 = myPageWidth - myX2;
    var myY2 = myPageHeight - myPage.marginPreferences.bottom;
    return [myY1, myX1, myY2, myX2];

  • If Are all the pictures can be enlarged to 160% with script in indesign cs6?

    a book is composing ,but the gest feel the picture is too small,all want to  enlarged to 160%,
    but there is Thousands pictrure, It is could be Achieve with script?
    just like thist

    @喜狼_edny – if you are using my script snippet, there is a undo in one go for the whole action.
    Furthermore if used with images anchored, make sure that the anchor settings are appropriate before.
    Before:
    (The container below is locked and will not scale)
    Anchor settings with wrong anchor reference point settings (German UI):
    After scaling (new position according to the anchor settings):
    Second try with different anchor settings:
    After running the script:
    Note: images locked or images on locked layers will not be scaled.
    This could be expanded. Eg. for images positioned on not visible layers.
    Images on the pasteboard etc.pp.…
    Uwe

  • Scripting Problem with the Default SplitStory.vbs Schript. Windows Scripting Error No. 429, ActiveX-Component cannot create object: 'InDesign.Application", Engine: Default File: C:\Program Files (x86)\Adobe\Adobe InDesign CS6\Scripts\Scripts Panel\Samples

    On another PC it works. I can't find any difference in the script line 15. I could run the Script 1 time and the 2nd time it Show this error
    Set myInDesign = CreateObject("InDesign.Application")
    Rem Set the user interaction level to allow the display of dialog boxes and alerts.

    Hi
    delete the tbl file so it regenerates see Re: InDesign CS6 scripts don't work on CC anymore
    HTH
    Trevor

  • Script for auto select of subtitle stream with 16:9 or 4:3 display

    I have an anamorphic 16:9 project that is set for 16:9 letterbox display. It is letterboxed in anamorphic for a 2.35:1 aspect ratio. I have 2 subtitle streams both identical in content. One stream is positioned for 16:9 displays with subtitles in the lower movie frame. The other stream is positioned for 4:3 displays with subtitles completely in the lower letterbox.
    I would like to create a script that can choose the appropriate stream depending on the user's setup (either 16:9 or 4:3). I would like the non-appropriate subtitle stream to appear non existent to the user. Basically, I don't want the user to have access to both of the streams. If they push the subtitle button on their remote, I would like to have just the proper one available. Can this be done in DVDSP? I'm not a total idiot with authoring, just not that experienced with scripting, so it's a little intimidating.
    I've gone as far to look in the manual and have found that SPRM 14 seems to be the key to display prefs. Could someone map out how to create such a script? Thank you.

    In general this script should work:
    mov GPRM0, SPRM14
    and GPRM0, 3072
    Set System Stream St(Subtitle Stream 1) (On) if GPRM 0 = 3072)
    Set System Stream St(Subtitle Stream 2) (On) if GPRM 0 != 3072)
    Jump Track 1
    The value of 3072 is returned when 16:9 value is stored in SPRM14.
    However some players may disregard this script as they might look for the presentation information in IFO files or in the video stream itself.
    The better approach is to flag one subtitle stream as 16:9 and the other as 4:3 in DVD After Edit if you have an access to it.
    MacPro 2.66, G5 DP 2.7   Mac OS X (10.4.9)   TASCAM DA-88, DigiBeta, DeckLink HD Extreme, Cinemacraft Encoder

  • Importing Microsoft Word doc to InDesign with embedded EPS art ~ scaling issue

    Hi, my workflow calls for creating content in Microsoft Word 2010 with embedded EPS art, in this case MathType 6.7a math objects. When I import these manuscripts (after saving as Word 97/2003 format) into my Adobe InDesign CS5.5 templates, the embedded inline graphics have been resized. Strangely, InDesign is keeping the container frame at the correct dimensions and then upsizing or downsizing the art inside that box.
    When I export a sample graphic from the Word file and unembed the same graphic after import it into InDesign, the two graphics are different sizes. InDesign might increase the size of one embedded graphic by 400% and then scale it down to 25% inside the anchored picture box and then in the next anchored picture box it might decrease the size the art to 50% and scale it to 200%.
    I did a test and created a graphic in Adobe Illustrator, saved it as EPS, placed the graphic into a Microsoft Word 2010 document, saved it out to 97/2003 format, imported that doc into an empty Adobe InDesign CS5.5 file. Again! InDesign changed the size of the art and re-scaled it to appear the same.
    I've been able to duplicate this issue on InDesign CS4 also, on both Windows XP and Windows 7.
    Has anyone else run into this issue? Does anyone know why the InDesign import filter doesn't import inline art in a Word document at 100%? Thanks for the help!

    My solution for this is:
    1. Place *.docx (yes, docx) word document with mathtype equations into indesign. This will set correct baseline for equations which is very important.
    2. download this scalegraphics script http://in-tools.com/downloads/indesign/scripts/ScaleGraphics.zip
    3. copy script from zip folder to C:\Program Files\Adobe\Adobe InDesign CS4\Scripts\Scripts Panel\Samples\JavaScript
    4. open palet (window/autoamtion/scripts) scripts, find new sript and run it
    Voila, all equations is at 100%...
    Script explanation: http://in-tools.com/article/scripts-blog/scale-graphics-script/
    In links palete equations have eps extension but this is embeded wmf files so you cant open them in photoshop or distill it with distiller.-((( I use export to pdf option in indesign to make pdf file.
    If you want all this eps links to export from indesign use this method:
    1. in links palete select all links
    2. in palete menu choose "unembed link"
    3. on answer window choose "no"
    4. select folder where you want indesign save files
    5. press "select"
    6.  now you have all links in new folder unembed from indesign document and you can edit it with mathtype.

  • Paragraph Alignment question - is it possible with scripting?

    Hello. I am working on a business card template that has a paragraph alignment problem. I have asked in other forums if it was possible, they pointed out that it might be, with scripting.
    I need to know if it is, so I can dig further.
    Here is the problem: I have a name and title on seperate line that need to be aligned to the right margin (the longest line touches the right margin) but centered above or below themselves. The text box is set to receive a large amount of characters. This is an automated system using InDesign Server so no manual adjustments are being made once the information has been submitted.
    Is this possible?

    Again, I don't know anything about ID Server, but you can try this. Label the text frame 'card' (select the frame, go to Window > Automation > Script label and enter a 'card' -- without the quotes).
    try
       tf = app.activeDocument.textFrames.item ('card');
       p0 = tf.paragraphs[0];
       p1 = tf.paragraphs[1];
       p0.justification = Justification.rightAlign;
       p1.justification = Justification.rightAlign;
       p0left = p0.insertionPoints[0].horizontalOffset;
       p1left = p1.insertionPoints[0].horizontalOffset;
       if (p1left > p0left)
          p1.rightIndent = (p1left-p0left)/2
       else
          p0.rightIndent = (p0left-p1left)/2;
    catch(_){}
    This one doesn't rely on a selection.
    Peter

  • How to make separate/individual text frame from one parent frame in indesign with javascript

    Hi all,
    Please suugest - how to make separate/individual text frame from one parent frame in indesign with javascript.
    Thanks
    Rohit

    @Larry – ah, your interpretation could be the right one…
    May I rephrase the question:
    "How to split threaded text frames to single ones?"
    "SplitStory.jsx" or "BreakFrame.jsx" under Scripts/Samples indeed could be the answer.
    From the comments in the code of "BreakFrame.jsx":
    //Removes the selected text frame (or text frames) from the
    //story containing the text frame and removes the text contained
    //by the text frame from the story.
    //If you want to split *all* of the text fames in the story, use the
    //SplitStory.jsx script.
    Uwe

  • [JS  CS3] Apply Italics with scripting

    There's a keyboard shortcut called "Apply Italics", which by default is [cmd]+[shift]+[i] on Mac, and  [ctrl]+[shift]+[i] on Windows. I use it often because it will change text to the correct italic style. For instance text with the style "85 Heavy" will change to "86 Heavy Italic" or "Semibold Display" to "Semibold Display Italic".
    Is there any way to access "Apply Italics" with scripting? The action is not available in any menu as far as I know.

    I made this script which will change all text with the character style "I" into proper italics, and creates corresponding character styles. "I" is just a character style with no properties. It gets applied when I import content into InDesign.
    I will end up with styles called "I 37 Thin Condensed Oblique", "I Italic Display" and so on according to the various fonts.
    function applyItalic(){ // Finds all text with Character Style "I" applied in the current document and changes it to proper italic character styles
         var mySelection = app.selection;
         var myDoc = app.activeDocument;
         var myRanges = myDoc.stories.everyItem().textStyleRanges.everyItem().getElements(); // gets every textStyleRange in the document;
         var italicStyle = myDoc.characterStyles.itemByName ("I"); // this character styles has no attributes;
         if (italicStyle == null){
              return;
         var myRange;
         var myFont;
         var newStyle;
         var newStyleName;
         var n;
         for (n=0; n<myRanges.length; n++){
              myRange = myRanges[n];
              if (myRange.appliedCharacterStyle==italicStyle){
                   app.select(myRange);
                   app.menuActions.itemByID(119611).invoke(); // apply italics - same as [cmd]+[shift]+[i]
                   myFont=myRange.appliedFont;
                   newStyleName="I "+myFont.fontStyleName;
                   newStyle=myDoc.characterStyles.itemByName(newStyleName); // if the style is created
                   if (newStyle==null){
                        newStyle=myDoc.characterStyles.add({name: newStyleName, fontStyle: myFont.fontStyleName}); // if the style does not exist yet
                   myRange.appliedCharacterStyle=newStyle;
         app.select(mySelection); // restores the original selection
    applyItalic();

  • Automating Process with Scripts

    Hello all,
    I am a seasoned JavaScript programmer, and am currently working on a project which requires a lot of work, and I'm hoping that the process can be automated using scripts for InDesign.
    Essentially, here's what I want to do. I have a 5 (sometimes, but rarely, 4)-digit string. I then have three rectangles underneath the text frame which I would like to apply a swatch to, depending on the final digits of the number. Numbers 0-9 are assigned a specific colour (and swatch), and at the moment I am manually going through each rectangle, and selecting it according to the last two digits, and applying the swatch to all those selected.
    I am convinced that it must be possible to automate the process using InDesign User Scripts, but I don't have a good understanding of this. Here's an example of how the colours are assigned to the special bar codes:
    0 = red 1 = blue 2 = green ....
    So for the following code: 12312, I would like the bars underneath to have the following colours:
    blue red blue
    (i.e. top and bottom row = penultimate digit; middle row = last digit).
    Could anyone indicate to me how I might write a script which loops through the pages in my document, finds the codes, extracts the last two digits and then applies a swatch to the rectangle object, depending on the number...
    I am confident that I could write something like this using regular JavaScript and HTML, but that having been said, I am familiar with the DOM in HTML...
    Any help or pointers would be gratefully received!
    Thanks,
    Ben.

    Scripting InDesign is a very different beast than scripting HTML.
    I highly recommend that you download Jongware's DOM in HTML or chm format and browse through it. It'll give you a pretty good idea of the DOM structure.
    http://www.jongware.com/idjshelp.html
    app.documents[0].pages gives you a collection of the active document's pages.
    app.documents[0].pages.everyItem().getElements() gives them to you as an array.
    pages have a textFrames collection. You can loop through that and check the contents of each frame for your numbers.
    app.documents[0].swatches.item("Color Name") gives you a swatch and a textFrame has a fillColor property.
    That should be enough to get you started...
    Harbs

  • How do I dynamically create a hyperlink in Indesign with vb

    Hi, does anyone know how to create a dynamic link to Indesign with vb? I'm coding a catalog from Access database with images and would like to make an "Enlarge image" hyperlink while generating the page. Somehow I seem to have no luck in my code. Thanks for any suggestions.

    As simple as it sounds to create hyperlinks with VB into Indesign CS4 it really took time and effort to finally
    come up with the solution. With the kind help of  Max Dunn an old InDesign scripting bug with VB was discovered responsible for this. But if you split the job into two parts it can be done.
    First make the document without hyperlinks in VB by putting the URLs in script labels on each graphic frame. Then in Indesing run a post-processing script in JavaScript that iterates through the graphic frames, and for each, if it has a script label, set that as the URL for hyperlink.
    Here is how I did it in Indesign.
    var myDocument = app.documents.item(0);
    for(var myCounter = myDocument.rectangles.length-1; myCounter >= 0; myCounter --){
    alert(myCounter)
    var myRectangle = myDocument.rectangles.item(myCounter);
    var myLabel = myDocument.rectangles.item(myCounter).label;
    try{
    myHyperlinkURL = myDocument.hyperlinkURLDestinations.add(myLabel);
    myHyperlinkSource = myDocument.hyperlinkPageItemSources.add(myRectangle);
    myHyperlink=myDocument.hyperlinks.add(myHyperlinkSource,myHyperlinkURL);
    myHyperlink.visible=false;
    catch(myError){

  • Reproducable Error with script SYS.I_PLSCOPE_SIG_IDENTIFIER$

    Hi Oracle,
    I get an error when running attached script:
    The error message is:
    ORA-00603: ORACLE server session terminated by fatal error
    ORA-00600: internal error code, arguments: [kqlidchg1], [], [], [], [], [], [], [], [], [], [], []
    ORA-00604: error occurred at recursive SQL level 1
    ORA-00001: unique constraint (SYS.I_PLSCOPE_SIG_IDENTIFIER$) violated
    00603. 00000 - "ORACLE server session terminated by fatal error"
    *Cause:    An ORACLE server session is in an unrecoverable state.
    *Action:   Login to ORACLE again so a new server session will be created
    DROP SEQUENCE T_TEAM_ID;
    DROP SEQUENCE T_COMPANY_ID;
    DROP TABLE t_company CASCADE CONSTRAINTS
    DROP TABLE t_team CASCADE CONSTRAINTS
    CREATE TABLE t_company
    id INTEGER NOT NULL ,
    name VARCHAR2 (20) NOT NULL
    ALTER TABLE t_company
    ADD CONSTRAINT PK_company PRIMARY KEY ( id ) ;
    CREATE TABLE t_team
    id INTEGER NOT NULL ,
    company_id INTEGER NOT NULL ,
    name VARCHAR2 (20) NOT NULL
    ALTER TABLE t_team
    ADD CONSTRAINT PK_team PRIMARY KEY ( id ) ;
    ALTER TABLE t_team
    ADD CONSTRAINT FK_t_team_t_company FOREIGN KEY
    company_id
    REFERENCES t_company
    id
    CREATE SEQUENCE T_COMPANY_ID
    NOCACHE
    ORDER ;
    CREATE SEQUENCE T_TEAM_ID
    NOCACHE
    ORDER ;
    CREATE OR REPLACE TRIGGER t_team_BI
    BEFORE INSERT ON t_team
    FOR EACH ROW
    WHEN (NEW.id IS NULL)
    BEGIN
    SELECT T_TEAM_ID.NEXTVAL INTO :NEW.id FROM DUAL;
    END;
    CREATE OR REPLACE TRIGGER t_company_BI
    BEFORE INSERT ON t_company
    FOR EACH ROW
    WHEN (NEW.id IS NULL)
    BEGIN
    SELECT T_COMPANY_ID.NEXTVAL INTO :NEW.id FROM DUAL;
    END;
    The error is thrown for the CREATE OR REPLACE TRIGGER and also comes up when creating the rest 1st, logging of and logging in again.
    As it seems to be a serious error (I'd never expect it to show) and I don't now how to solve it, I wrote you this bug report.
    I'm on Win7 Pro and using SQL Developer 3.0.04. Oracle version installed is:
    SELECT * FROM V$VERSION
    where banner like 'Oracle%';
    BANNER
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
    Any advise or idea how to solve the error?
    Thank you,
    Blama

    Error with script SYS.<...>Using sysdba connections for schemas is strongly discouraged.
    Creating tables in the system tablespace that have no relation to the sys and system schemas brings its own set of admin headaches, sysdba should only be used to shutdown or startup an instance.
    Or if there is a specific SYS object that needs to have permissions granted that cannot be done via a user with the DBA role privilege (i.e. SYSTEM), that should be the only time a sysdba connection is needed.
    Also, beginning with 11g the pl/sql for setting a column with a sequence value can be done directly, no 'select ... into ... from dual;' needed.
    begin
      :new.<column> := <sequence>.nextval;
    end [<trigger name>];

  • Hello Friends, I am new in InDesign Java Script

    Hello Friends,
    I am new in InDesign Java Script. I want to edit the page's master text Frame Object through Java Script. Any Idea regarding this will help me a lot.
    thanks in advance

    Have you read any of the documentation? It doesn't seem so :-)
    Vivek Singh, the documentation is a great tool for understanding object model. Once you got the main concept of hierarchy between objects, accessing objects is quite a child game.
    I am not meaning scripting is easy but have a look on the documentation, it's a essential starting point. I bought too the Peter Karhel's guide
    http://oreilly.com/catalog/9780596528171/index.html
    it's really cheap regarding to the quality of the learning.
    Welcome in this world.
    BTW, masterspreads is a property of document. So you should work with something like :
    app.activeDocument.masterSpreads[0].xxx
    Loic

  • Running InDesign CS3 Script like a service

    Hi,
    Do anybody know if is there any option to run an InDesign CS3 Script as a service or daemon? I would like to execute some actions depending on some others and I need to have an script running all the time and checking for certain states.
    Thanks
    Aleix

    Hi,
    Can you give me information for both cases? The truth is that I need to monitor something related with an InDesign plug-in and maybe one or both methods could help me.
    Thanks
    Aleix

  • Creating Database with Script

    Can any body guide me how to create DB with scripts, Here is the scripts
    ls -ltrtotal 6952
    -rw-r----- 1 oracle oinstall 7061504 Dec 4 11:17 tempControl.ctl
    -rw-r----- 1 oracle oinstall 2057 Dec 4 11:17 rmanRestoreDatafiles.sql
    -rwxr-xr-x 1 oracle oinstall 948 Dec 4 11:17 PSC01P1.sql
    -rwxr-xr-x 1 oracle oinstall 645 Dec 4 11:17 PSC01P1.sh
    -rw-r----- 1 oracle oinstall 682 Dec 4 11:17 postScripts.sql
    -rw-r----- 1 oracle oinstall 2634 Dec 4 11:17 initPSC01PTemp.ora
    -rw-r----- 1 oracle oinstall 2719 Dec 4 11:17 initPSC01PTempOMF.ora
    -rw-r----- 1 oracle oinstall 2621 Dec 4 11:17 init.ora
    -rw-r----- 1 oracle oinstall 185 Dec 4 11:17 CreateClustDBViews.sql
    -rw-r----- 1 oracle oinstall 915 Dec 4 11:17 CloneRmanRestore.sql
    -rw-r----- 1 oracle oinstall 1756 Dec 4 11:17 cloneDBCreation.sql
    -rw-r----- 1 oracle oinstall 954 Dec 4 11:18 postDBCreation.sql

    None of any script will help u. Followings are the steps to create manually database
    Assume you have selected f drive for the same -
    1. Choose drive with sufficient disk space
    2. create folder (folder_name)
    3. create bdump,cdump,oradata,pfile folder in (folder_name) folder
    4. open notepad and create pfile as named "init_sidname.ora" with required parameters (check parameters in sample pfile or ask to resend
    5. go to os prompt
    6. type commands
    oradim -new -sid init_sidname.ora -startmode m -pfile (path of init_sidname.ora file with filename)
    orapwd file=f:\oracle\ora92\database\pwd_nameoffile.ora password=sysdba entries=3
    create a sql script to create database with extention .sql
    set oracle_sid=sid_name
    sqlplus /nologsql>connect sys as sysdba
    password : sysdba
    sql> create spfile from pfile=(path of pfile)
    (it will create spfile in database folder of ora92 folder)
    sql> startup nomount
    sql> execute catalog.sql and catproc.sql scripts
    your database will be create and can be checked with select commands like
    select * from dba_datafiles;
    Rajesh thakur

Maybe you are looking for