Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all 37788 articles
Browse latest View live

Re: layer hierarchy?

$
0
0

Thanks, greenrookie.

That did the trick. I just put my geometric bounds back to the original settings in my script and everything is working great now.

Thanks very much for the help.


Re: How to select all text in active text frame?

$
0
0

Here you go:

 

if (app.selection.length > 0 && app.selection[0] instanceof TextFrame) {    frame = app.selection[0];    frame.parentStory.contents = '';    frame.insertionPoints[0].select();    app.paste();    frame.parentStory.insertionPoints[-1].contents = '\r\r';
}

 

Peter

Re: Change links path to new server

$
0
0

Hi,

 

Try this,

 

var doc = app.activeDocument,    links = doc.links.everyItem().getElements(),    _folder = Folder.selectDialog("Select new path"),    _files = [];


getAllFiles(_folder);

var len = links.length;
while(len--)
{
    for(var i=0;i<_files.length;i++)    {        if(links[len].date.toString() == _files[i].modified.toString()){            if(_files[i].name == links[len].name)            {               links[len].relink(new File(_files[i].fsName));            }        }    }
}

function getAllFiles(folder)
{
    var filelist = folder.getFiles();    for(var i =0;i<filelist.length;i++)    {        if(filelist[i] instanceof Folder)        {            getAllFiles(filelist[i]);        }        else if(filelist[i] instanceof File)        {            _files.push(filelist[i]);        }    }
}

 

Regards,

Chinna

Re: Re: How to delete xml content without deleting the content of the object?

$
0
0

Is this you asking?

 

var doc = app.activeDocument;
var text = doc.xmlElements.item(0).evaluateXPathExpression("//text");

for(var i =0;i<text.length;i++)
{        text[i].texts.everyItem().remove();    }

 

Regards,

Chinna

How to identify the page is master page

$
0
0

I'm having page object, need to identify whether its master page or not?

Re: How to identify the page is master page

$
0
0

If the parent of the page is masterSread then it is a masterpage.

Re: Re: How to identify the page is master page

$
0
0

Hi,

 

May the below code also helpful for you:

 

var myPages = app.activeDocument.pages;

alert(myPages.length)

for(i=0; i<myPages.length; i++)
{    if(myPages[i].appliedMaster == null)    {        alert("Blank Page is : " + myPages[i].name)        }    else    {        alert("Applied Master Page  is : " + myPages[i].name)    }
}

 

 

Thanks

Siraj

InDesign CS6 scripts don't work on CC anymore

$
0
0

Hi there,

 

I've made a lot of vb scripts for InDesign CS6. Now, on CC they don't seem to work anymore. Java scripts work fine and can be started from within the InDesign application. But my vb scripts only can be started from within the explorer instead of the InDesign application.

 

Anyone a clue, where the problem might be?

 

Thanks & greetings

Lukas


Re: InDesign CS6 scripts don't work on CC anymore

$
0
0

@Lukas – I'm on Mac OSX, so cannot be very helpful with that.
Do the pre-installed Adobe sample VB Scripts work for you?

 

Hm. I think, this thread should be moved to the InDesign Scripting Forum…
InDesign Scripting

 

Uwe

I need an alert message if I press ctrl shift b

$
0
0

Hi All,

 

I Need an alert message if I Press "ctrl+shift+b"(to make the selected text bold). Is this possible?

 

Regards,

Chinna

Re: How to select all text in active text frame?

$
0
0

Thank you Mr. Kahrel for your quick reply.

The script is working great!

 

But... (there is always one )

 

I didn't define my first step correctly. Under "active text frame" I ment text frame where I clicked with type tool ("text editing mode"). Your script is working only when the frame is selected with selection tool. If you would be so kind to help me with that little thing!

 

And I changed -1 to 0, to put two \r in the beginning of text.

 

Thank you,

Hunor

Re: I need an alert message if I press ctrl shift b

$
0
0

Create a keyboard shortcuts (ctrl + shift + b) for your script and try...

 

Code must be like this:

 

alert("Bold Shortcut....");
app.selection[0].fontStyle = "Bold";

 

P.S.: you have to set conditions for bold, bold italic, etc. 

 

Vandy

Re: I need an alert message if I press ctrl shift b

$
0
0

Hi Vandy,

 

Thanks for the replay. It works fine.

 

But im expecting an eventlistener for the keystroke. Is this possible in indesign.

 

Regards,

Chinna

Re: Re: I need an alert message if I press ctrl shift b

$
0
0

Try this,

 



#targetengine session
app.menuActions.itemByID(119610).eventListeners.add("beforeInvoke", function()
{
alert("Bold");
});

 

Note: place the above js file in startup script folder

 

Vandy

Re: InDesign CS6 scripts don't work on CC anymore

$
0
0

Oh, sorry! I forgott to write that. No, the preinstalled scripts don't work either. Only the java scripts work fine.


Re: How to delete xml content without deleting the content of the object?

$
0
0

Dear Fred,

 

Please use the below Code, this will helps you to achieve your target.

 

 

//============================== Script Starts ============================================//

 

var doc = app.documents[0];

 

//========================================================================//

 

/* Use Glue Code */

 

//==================================================================//

 

__RemoveXMLElments(doc);

 

function __RemoveXMLElments(doc)

{

      var elementXpath = "//text";

        var myRuleSet = new Array (new __RemoveXMLElments_XPath(elementXpath));

      with(doc){

        var elements = xmlElements;

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

        }

}

 

 

function __RemoveXMLElments_XPath (Txts)

{

        this.name = "RemoveTexts";

        this.xpath = Txts;  

        this.apply = function(myElement, myRuleProcessor){

            with(myElement){

                try{  

                        var myCnts = myElement.texts.everyItem();

                        myCnts.remove();

                  }catch(e)

                    {

                        }

              }

          }

    }

 

//============================== Script End============================================//

 

Thanks & Regards

T.R.Harihara SudhaN

Re: Re: How to select all text in active text frame?

$
0
0

Here you go again---

 

if (app.selection.length > 0 && app.selection[0].hasOwnProperty ('parentTextFrames')) {    frame = app.selection[0].parentTextFrames[0];    frame.parentStory.contents = '';    frame.insertionPoints[0].select();    app.paste();    frame.parentStory.insertionPoints[-1].contents = '\r\r';
}

 

Peter

Re: Map tags to styles (CS6, Applescript)

$
0
0

Hello, try

 

tell application "Adobe InDesign CS6"

    set myDocument to active document

    tell myDocument

        set tList to name of every XML tag

        set tNumItems to count of tList

      

        -- XML tag to style mapping by name.

        repeat with j from 1 to tNumItems

            set tStyle to item j of tList

            make XML import map with properties {markup tag:tStyle, mapped style:tStyle}

        end repeat

        --Map tags to styles.

        map XML tags to styles

        --Map styles to XML tags by name

        repeat with j from 1 to tNumItems

            set tStyle to item j of tList

            make XML export map with properties {markup tag:tStyle, mapped style:tStyle}

        end repeat

      

        --Map styles to tags.

        map styles to XML tags

    end tell

    --Export xml para desktop para pasta a designar

    tell active document

        export to "xxxxxxxxx:aaaaaaaaa.xml" format "XML"

    end tell

end tell

Re: I need an alert message if I press ctrl shift b

Re: InDesign CS6 scripts don't work on CC anymore

$
0
0

OK. I moved this into the scripting forum.

 

While you wait for someone who actually has a clue, have you tried trashing your prefs? See Replace Your Preferences

Viewing all 37788 articles
Browse latest View live


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