6 Replies Latest reply on Jun 15, 2009 6:46 AM by RockScript

    script label

    RockScript Level 1

      How to add script label in masterface of indesign cs3.

        • 1. Re: script label
          [Jongware] Most Valuable Participant

          Most ID objects have a "label" property -- a simple string, that can be read and written:

           

          app.activeDocument.label = "my label";

           

          but I don't know what you mean with "masterface" ... A MasterSpread? [Its description in the Help is, very helpfully, "A master spread."]

           

          You can see and change the labels for regular objects by opening the Script Label panel. Tip: if you want to change it there, you cannot just press "Enter", that gets entered into the label. Use "Ctrl+Enter" instead.

          Other labels, such as aforementioned Document (and pages and master spreads as well) cannot be entered or viewed, you need a script to access these.

          • 2. Re: script label
            Harbs. Level 6

            What's a masterface?

             

            Harbs

            • 3. Re: script label
              RockScript Level 1

              masterpage

              • 4. Re: script label
                RockScript Level 1

                Actualy i want to insert Header and footer through my script in indesign cs3.it like this wht is the problem

                 

                This is process result: 0  header for recto processed

                 

                Input Error list:

                 

                HeaderForRecto :The Following Pages not has Header TextFrame
                3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,

                • 5. Re: script label
                  Harbs. Level 6

                  I'm afraid I did not understand what you're trying to do, and/or how you are trying to g about it...

                   

                  Harbs

                  • 6. Re: script label
                    RockScript Level 1

                    This is mycode . For CS3 i changed somecode but it is not working. This is for insert header and footer in indesgin CS3.

                     

                    Below i attached code.pls tell me for cs3 where i need to modify.

                     

                     

                    function HeaderForRecto(Header_Sty)
                    {
                        var ctt;
                        var temp_header="";
                        var ItemNam="Header";
                        overriding_header_tf(ItemNam)
                        var searchParaStyleStr=Header_Sty;
                        ctt=0;
                        for(var i=0;i<myDoc.pages.length;i++)
                        {try{
                            var mypagg=myDoc.pages[i];
                            if(mypagg.textFrames.length>0)
                            {
                            for(var k=0;k<mypagg.textFrames.length;k++)
                            {
                                var mytf=mypagg.textFrames[k];
                                if((mytf.label!="Header")&&(mytf.characters.length>0))
                                {
                                    for(var j=0;j<mytf.paragraphs.length;j++)
                                    {try{
                                            var mypara=mytf.paragraphs[j];
                                                try{
                                            var flag_status=check_style(mypara,searchParaStyleStr)
                                                    }
                                                    catch(e)
                                                    {}
                                            if(flag_status==1)
                                            {
                                                try{
                                            temp_header=header_RemoveUnReadableChar(mypara.contents);
                                                    }
                                                    catch(e)
                                                    {}
                                            header_flag=1;
                                            }//if
                                        }
                                        catch(e)
                                        {}
                                    }//for-para
                                }//if
                            }//textframe
                            }//if
                            //-------------------------
                        if(header_flag==1)
                        {
                                    try{       
                                            var mytf=mypagg.parent.textFrames.item(ItemNam);
                                             var mycont=mytf.contents;
                                             //var reg=new RegExp(/[a-z,A-Z,0-9, ]+/g);
                                             var reg=new RegExp(/[a-z,A-Z,0-9]+(.*|\n)*[a-z,A-Z,0-9]+/g);
                                            var m=reg.exec(mycont);
                                                if(m!=null)
                                                {
                                                m[0]=trim(m[0])
                                                app.findTextPreferences = app.changeTextPreferences = null
                                                app.findTextPreferences.findWhat=ItemNam;
                                                app.changeTextPreferences.changeTo=temp_header;
                                                mytf.parentStory.changeText();
                                                var searching=mytf.search(m[0],false,undefined,temp_header)
                                                ctt++;
                                                }
                                        }
                                        catch(e)
                                        {
                                   
                                         }
                        }
                                //------------------------
                            }
                            catch(e)
                            {}
                         }//for-page
                         return ctt;
                    }//fun