Skip to main content
Inspiring
July 22, 2014
Answered

Why this script unfunction?

  • July 22, 2014
  • 3 replies
  • 536 views

Hi, everyone

I add an  UndoModes.FAST_ENTIRE_SCRIPT to the script, but unfunction, can you fix it?

app.doScript('main()', ScriptLanguage.JAVASCRIPT, undefined, UndoModes.FAST_ENTIRE_SCRIPT, "Indent Paragraphs"); 

function main(){

var curSel = app.selection[0]; 
for ( var i = 1; i < app.documents.length; i++) { 
    var nextDoc = app.documents
    if (!curSel) { alert( "Nothing selected!" ); exit(); } 
    curSel.duplicate( nextDoc.masterSpreads[0] ); 
}
}

John

This topic has been closed for replies.
Correct answer Laubender

@John – Why do you think it is *not* working?

It does what you have coded:
Duplicate the first selected object to the first master spread of every other document that is open.

The whole action can be undone when one of the other documents get the focus.

Uwe

3 replies

JohnwhiteAuthor
Inspiring
July 23, 2014

Hi, Uwe

I use win 7, cs6

so, I don't know

may be win 7 and mac have something diffident

John

JohnwhiteAuthor
Inspiring
July 23, 2014

Hi, Uwe

it works in mac

but I don't know how it unfuncton in win7

thanks

John

JohnwhiteAuthor
Inspiring
July 23, 2014

Hi, Laubender

You mean my script is working?

What if I use Indesign CS5 in Mac OSX 10.7.5?

I will tast.

Thanks!

Regard

John

LaubenderCommunity ExpertCorrect answer
Community Expert
July 23, 2014

@John – Why do you think it is *not* working?

It does what you have coded:
Duplicate the first selected object to the first master spread of every other document that is open.

The whole action can be undone when one of the other documents get the focus.

Uwe

Community Expert
July 23, 2014

@John – Your code is working.

The undo by the name of "Indent Paragraphs"  is available in all documents you successfully used in the for loop.

I tested it with InDesign CS6 on Mac OSX 10.7.5.

Uwe