Script to move the playhead randomly to executives?

Is it possible to have a script that sends the playhead to specific images at random, wait about 8 seconds then go?

For example, frames 1-20 will have an image on each image. I want the playhead to land on these images in a different order and keep a loop.

Thank you

I did not code it if you return to section 1, code it so that when you return to frame 1, you launch a setInterval another... you want only a job.  If you place the following code in frame 1 it will take care of it, leaving a setInterval be activated...

Stop();

var intervalID; intervalID is undefined here because there is nothing assigned

if(!intervalID) {/ / will only when intervalID is undefined}
intervalID = setInterval (moveToFrame, 3000); defines intervalID
}

function moveToFrame() {}
gotoAndStop (Math.floor (Math.random () * 4) + 1);
}

Tags: Adobe Animate

Similar Questions

  • Script to move the same objects of value of color to a layer

    I have a range of color objects upward into process colors, and I would like to the moved to the individual layers of script.

    so the result would be to move all items from cyan to CYAN layer, move all the magenta elements to the Magenta layer, etc. etc.

    Could someone help please?

    Thank you very much

    something like this will do the trick.

    Don't forget: this can make a mess of your z-order...

    function seperate_items_to_layers_by_colour(){
        var doc = app.activeDocument;
        var item = doc.pageItems;
        var C_lay = make_layer_if_needed("CYAN");
        var M_lay = make_layer_if_needed("MAGENTA");
        var Y_lay = make_layer_if_needed("YELLOW");
        var K_lay = make_layer_if_needed("BLACK");
    
        for(var i=0; i		   
  • action or a script to move the selection to the specified layer?

    Hi all

    I have a work of art on 'Layer 1' I need to shrink and duplicate "layer 2". I do this several times a day, so I was hoping someone could help me with a script? The two layers are always named the same. I work in CS5.


    Thank you very much!

    Here you go

    var scale = 50; // 50 means 50%, change this to your needs
    
    var idoc = app.activeDocument;
    var ilayer = idoc.layers['Layer 2'];
    var sel = idoc.selection;
    var selen = sel.length;
    
    for (i=0; i		   
  • Script to move the description metadata information in the title field

    I tried for 2 days (market) to try to get Bridge CS6 to copy the information in the Description field for the field title in the metadata. I can get it in the menu, but nothing happens when I change other scripts. Any suggestions would be greatly appreciated.

    If you want a good laugh, I can post my previous attempts.

    It is a way to copy the information...

    #target bridge
     if( BridgeTalk.appName == "bridge" ) {
    descToTitle = MenuElement.create("command", "Description to Title", "at the end of Tools");
    }
    descToTitle.onSelect = function () {
     if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
     var thumb = app.document.selections;
        for(var s in thumb){
     if(thumb[s].hasMetadata){
            var selectedFile = thumb[s].spec;
      var myXmpFile = new XMPFile( selectedFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
      var myXmp = myXmpFile.getXMP();
             var Description =  getArrayItems(XMPConst.NS_DC, "description");
            myXmp.deleteProperty(XMPConst.NS_DC, "title");
            myXmp.appendArrayItem(XMPConst.NS_DC, "title", Description, 0, XMPConst.ALIAS_TO_ALT_TEXT);
            myXmp.setQualifier(XMPConst.NS_DC, "title[1]", "http://www.w3.org/XML/1998/namespace", "lang", "x-default");
        }
    function getArrayItems(ns, prop){
    var arrItem=[];
    try{
    var items = myXmp.countArrayItems(ns, prop);
     for(var i = 1;i <= items;i++){
     arrItem.push(myXmp.getArrayItem(ns, prop, i));
         }
    return arrItem;
    }catch(e){alert(e +" Line: "+ e.line);}
    }
            if (myXmpFile.canPutXMP(myXmp)) {
            myXmpFile.putXMP(myXmp);
            myXmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
             } else {
      xmpFile.closeFile();
            }
        }
    }
    
  • Move the playhead to the parent SWF

    Hi all,

    I have a sticky wicket... for reasons too complex to get in, I am obliged to enter a quiz of CP in a Flash application (using the class loader).

    The problem... when the user completes the quiz and (SUCCESS or FAILURE) I need the parent Flash animation timeline to advance to the next (frame or image designated tag)... basically, if the user passes the quiz, they can continue to see the rest of the material demand... but if they fail, they need to take another quiz who is in charge in another frame... in both cases, the parent Flash timeline MUST change position of playing with your head...

    Thanks in advance

    DID IT!

    King of widget, thanks for your post, but I think that I thought about it.

    I created a button in flash, inserted the AS3 below, insert the Flash as an animation in first Grade... and when I loaded CP into Flash project and clicked the button... He went to the image tag specified button.

    This is the code I used:

    BUTTON_INSTANCE_NAME.addEventListener (MouseEvent.CLICK, FUNCTION_NAME);

    function FUNCTION_NAME(event:MouseEvent):void {}
    MovieClip (parent.root.parent.root) .gotoAndStop ("FRAME_NUM_or_FRAME_LABEL");
    }

    The key has been the path to the Flash timeline... Thanks for putting me on the right track...

  • Sound in a movie clip malfunctions when the playhead is moved backward

    Summary of the problem:

    A his (flow) placed inside a clip that is in another video clip begins to play continuously when I use control of the game to jump on the main timeline.

    Details:

    I am using Flash CS3, but the same problem occurs with CS6. I have spent quite a bit of time to research/search for the number but has not found a solution. To illustrate the problem, I reduced the flash animation to a very simple structure.

    A the main timeline:

    • The first image has a clip (Game MC) and a stop action.
    • Following the first image, there are several frameworks, for the most part empty except for the text.
    • The last image has a stop action.

    On the timeline of the Game MC :

    • There is that one frame. In this image, there is a clip (Map MC) and the stop action.

    On the chronology of the MC card :

    • It starts with 3 images of virgins and a stop action.
    • Starting with 4 frame, a his (.wav format) is placed and is set to be 'stream '.
    • At the end of this period, there is a stop action.

    Flash CS3, I press Ctrl + Enter to test the movie. The film stops on frame 1 of the main timeline with the card not showing, no sound, as expected. Now, I use "." to move the head piece forward one frame at a time. No problem. I see the images after the first image. Still no sound, as expected. So far so good.

    The problem starts when I use ',' to move the playhead to the rear, the sound in the MC card begins to play, no matter where the head piece is, even when the game MC (of there the map MC) is not on the scene. Worse, each press of the ',' will trigger another start of the overlay sound even with the previous. And the sound would continue looping until I close the SWF.

    However, the problem will occur if I place the MC card directly on the main timeline. It only happens when it is inside another video clip (game MC).

    I need to solve this problem, because the full version of the game of flash cards must be placed in a HTML page with a javascript based, playback control that allows the Viewer to jump around the chronology of swf.

    The fla file is: https://docs.google.com/file/d/0B_5mgotjr4l5RDZaOGxFeFFWN1U/edit?pli=1

    I'm doing something wrong? Is this a bug in Flash? Any ideas will be greatly appreciated.

    Keith

    It is a bug in flash.

    to remedy this, use the sound class to play your sound:

    var s:Sound1 = new Sound1();  where Sound1 is classname you assign to your sound.

    s.Play ();

  • Move the group to another group

    Hi all

    Can help to create a script to move the group named "Shine" in another group named "shine everything."

    Thanks in advance.

    Snapshot show for a better understanding.

    set.jpg

    Does that help?

    // move groups of a certain name into group of a certain name;
    // 2015, use it at your own risk;
    #target "photoshop-70.032"
    if (app.documents.length > 0) {
    var myDocument = app.activeDocument;
    var name1 = "Shine";
    var targetName = "Shine All";
    var targetGroup = layersWithName (targetName);
    // if exactly one group qualifies;
    if (targetGroup.length == 1) {
    // collect groups;
    var theGroups = layersWithName(name1);
    // process groups;
    for (var m = theGroups.length - 1; m >= 0; m--) {
      moveTo(theGroups[m][1], targetGroup[0][1]);
      };
    }
    else {alert ("too many or too few groups called »"+targetName+"«")}
    };
    ////////////////////////////////////
    function layersWithName (thisName) {
    // the file;
    var myDocument = app.activeDocument;
    // get number of layers;
    var ref = new ActionReference();
    ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
    var applicationDesc = executeActionGet(ref);
    var theNumber = applicationDesc.getInteger(stringIDToTypeID("numberOfLayers"));
    // process the layers;
    var theLayers = new Array;
    for (var m = 0; m <= theNumber; m++) {
    try {
    var ref = new ActionReference();
    ref.putIndex( charIDToTypeID( "Lyr " ), m);
    var layerDesc = executeActionGet(ref);
    var layerSet = typeIDToStringID(layerDesc.getEnumerationValue(stringIDToTypeID("layerSection")));
    var isBackground = layerDesc.getBoolean(stringIDToTypeID("background"));
    // if not layer group collect values;
    if (layerSet != "layerSectionEnd" /*&& layerSet != "layerSectionStart"*/ && isBackground != true) {
    var theName = layerDesc.getString(stringIDToTypeID('name'));
    var theID = layerDesc.getInteger(stringIDToTypeID('layerID'));
    if (theName == thisName) {
    theLayers.push([theName, theID)
    }
    };
    }
    catch (e) {};
    };
    return (theLayers)
    };
    ////// move //////
    function moveTo (theLayer, theGroup) {
    // get index;
    var ref = new ActionReference();
    ref.putIdentifier( charIDToTypeID( "Lyr " ), theGroup - 1);
    var layerDesc = executeActionGet(ref);
    var theIndex = layerDesc.getInteger(stringIDToTypeID("itemIndex"));
    // =======================================================
    var idmove = charIDToTypeID( "move" );
        var desc5 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref4 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            ref4.putIdentifier( idLyr, theLayer );
        desc5.putReference( idnull, ref4 );
        var idT = charIDToTypeID( "T  " );
            var ref5 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            ref5.putIndex( idLyr, theIndex );
        desc5.putReference( idT, ref5 );
        var idAdjs = charIDToTypeID( "Adjs" );
        desc5.putBoolean( idAdjs, false );
        var idVrsn = charIDToTypeID( "Vrsn" );
        desc5.putInteger( idVrsn, 5 );
    executeAction( idmove, desc5, DialogModes.NO );
    };
    

    under the direction

  • Error trying to move the file using the file adapter

    Hi, I'm looking for a script to move the file to one remote folder to another by file adapter as described in the topic 4.5.11.1 to http://download.oracle.com/docs/cd/E21764_01/integration.1111/e10231/adptr_file.htm#CHDGFAAB. But I get the below error:

    input > < message > <
    < Invoke1_FileMove_InputVariable > < part name = "Empty" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" > < empty xmlns = "http://xmlns.oracle.com/pcbpel/adapter/opaque/" / > < / piece > < / Invoke1_FileMove_InputVariable > < / input > < fault >
    < bpelFault > < faultType > 0 < / faultType > < bindingFault xmlns = "http://schemas.oracle.com/bpel/extension" > < a name = "summary" part > < summary > Exception is is produced when the link has been invoked.
    Exception occurred during invocation of the JCA binding: "* JCA binding run operations reference 'FileMove' have to: Exception occurred when setting has been invoked.*.
    * Exception occurred during invocation of the JCA binding: "* failed to instantiate InteractionSpec oracle.tip.adapter.file.outbound.FileReadInteractionSpec reason: cannot set JCA WSDL perte.*."
    * The WSDL of JCA perte.* definition error *.
    * The setSourcePhysicalDirectory property is not set to oracle.tip.adapter.file.outbound.FileReadInteractionSpec *.
    * Please check the spelling of the perte.* *.
    ".
    The called JCA adapter threw an exception of resource.
    Please review the error message above carefully to determine a resolution.
    ".
    The called JCA adapter threw an exception of resource.
    Please review the error message above carefully to determine a resolution.
    < Summary / > < / part > < part name = "detail" > < details > can not set the WSDL JCA property.
    Error setting property of WSDL JCA.
    SetSourcePhysicalDirectory property is not set to oracle.tip.adapter.file.outbound.FileReadInteractionSpec
    Please check the spelling of the property.
    < / detail > < / part > < part name = "code" > < null code > < / code > < / piece > < / bindingFault > < / bpelFault > < / fault > < faultType >
    < message > 0 < / message > < / faultType > < / messages >

    Please provide any idea if someone tried it.

    Thank you
    RPS

    Hi rps.

    Your interaction-spec className seems to be incorrect (FileReadInteractionSpec).

        
     .....
        
    

    Please try with the specifications of interaction above and let me know the results.

    Kind regards
    Neeraj Sehgal

  • Advice to move the timeline

    Tries to get the hang of this thing first and serve as many shortcuts as possible. I've skimmed through and picked up valuable online help (as - +-to zoom in)

    Is it possible to scroll vertically without counting that the scroll bars? The hand tool only wants to scroll horizontally.

    Also, if I zoomed in, how I scroll the timeline? Page up/down gets me only to the next clip.

    All shortcuts spinning open a track?

    Finally, there is a kind of detector of the gap? It is a pain to try to track down the gaps in Framework 1.

    Where is the command "move the playhead to cursor"? What CS5.5? I can't find.

    Oh! Thanks Adobe for changing the name of the CTI at the playhead in CS5.5; It was a totally unnecessary change. Anyway, Yes, they exist in CS5, just like "Move CTI slider."

  • Flash CS5 advance the playhead to the next scene

    Hello

    Please forgive a simple question, I have not used the Flash for centuries.

    In Flash CS5 someone knows how to move the playhead to frame 1 of next scene? I may be wrong, but I thought that older versions of Flash would do it automatically.

    My scenes are a loop that is fine for some but not for others.

    I thought that I used to put a "goto and play" action on the last frame to return to section 1 of the current scene, if I wanted it shut.

    Otherwise, it would advance to the next scene.

    I can't find 'go and play' action except a clickable that you attach to a button.

    I tried to add a behavior but to get the message

    "This function is not supported by ActionScript 3.0. To use this feature, you must

    target the ActionScript 1.0 - 2.0 "

    Thank you for sharing your wisdom

    s

    by default, the playhead still coming through scenes.  If you are stopping on the last frame of a scene and is not to the next scene, there must be something that.

  • How to move the frame with the title of undefined to specific layer script?

    I use currently using a script to move specifically named blocks of text and page for the corresponding layers elements (this is to make a catalog with several languages)

    It looks like this:

    ---------------------------------------------------------------

    App.documents [0].textFrames.Item ("NL") .itemLayer = "NL";

    App.documents [0].textFrames.Item ("en") .itemLayer = "EN";

    App.documents [0].textFrames.Item ("es") .itemLayer = "ES";

    App.documents [0].textFrames.Item ("from") .itemLayer = "OF";

    App.documents [0].textFrames.Item ("pl") .itemLayer = "PL".

    App.documents [0].textFrames.Item ("base") .itemLayer = "BASIC";

    App.documents [0].pageItems.Item ("base") .itemLayer = "BASIC";


    ---------------------------------------------------------------

    If it works fine. All items have been marked beforehand and put in some sort of model that we still use and yet (we use EasyCatalog so if you don't know what I'm talking about, it doesn't make much sense to do it this way)

    What I feel is missing is a piece of code that can detect the elements without any script tag, because there is always a lot of handwork to do too much, and new elements - who have no title of script - can get stranded on wrong layers if you don't pay attention.

    So basically, I would that all executives without labels, are transferred to the layer "BASE". It seems possible, but I can't find good examples anywhere...

    Hello

    Try this.

    var txfms = app.activeDocument.pages.everyItem ().textFrames.everyItem () .getElements ();

    for (var i = 0; i)<>

    {

    If (txfms [i] .label == "")

    {

    .itemLayer txfms [i] = 'BASE '.

    }

    }

    Kind regards

    Cognet

  • Get a script on Netflix error, when I try to move the film forwward or return.

    I recently switched from IE to Mozilla Firefox, mainly because it is so much faster. I don't use IE any more. I deleted from my computer. Ever since then with Mozilla, when I try to move the film forward or backward on NetFlix, everything freezes. If I persist, I get an error "running scripts" and a suggestion that I stop to run. When I do so it seems (?) fix the problem. It wasn't a problem with IE.
    Help, please.
    Boyo

    See also:

  • Scripts do not move the opacity masks

    I use the following script to move an item with an opacity mask in illustrator.

    activeDoc var = app.activeDocument;

    selectedItem = activeDoc.selection var [0];

    selectedItem.translate (-10, -10);

    The element moves, but the opacity mask stays in the same place. I confirmed that the opacity mask is locked with the element. I also see an element of form in the data browser. The vector object that was used to create the opacity mask is no longer present in the data view. Any ideas?

    My script actually ended out mistake when an item that you are trying to select once again has a sub hidden element. To work around this problem, I have actually used script dialogue for the relocation of Silly-V to replace my actions of alignment. The result is the following. I have confirmed that it works with the hidden items sub and opacity masks.

    function ActionManager() {}

    this.currentLoadedSets = [];

    this.checkLoadedSets = {function (setName)}

    {If (this.currentLoadedSets.length > 0 & {this.currentLoadedSets.join("").match (setName))}

    Returns true;

    } else {}

    Returns false;

    }

    };

    this.alertLoadedSets = function() {}

    var arr = [];

    for (var i = 0; i)< this.currentloadedsets.length;="" i++)="">

    arr.push (this.currentLoadedSets [i]);

    }

    Alert (arr. Join ("\n"));

    };

    this.loadSet = function (setString, setName) {}

    this.removeSet (setName);

    var aiaFile;

    If (typeof setString == "string") {}

    aiaFile = new File ('~/ScriptAction.aia');

    aiaFile.open ("w");

    aiaFile.write (setString);

    aiaFile.close ();

    app.loadAction (aiaFile);

    this.currentLoadedSets.push (setName);

    aiaFile.remove ();

    Returns true;

    } ElseIf (setString instanceof File) {}

    aiaFile = setString;

    {if (aiaFile.Exists)}

    app.loadAction (aiaFile);

    this.currentLoadedSets.push (setName);

    Returns true;

    } else {}

    Alert ("file" "+ decodeURI (aiaFile) +"' is not found!) ") ;

    Returns false;

    }

    }

    };

    this.playAction = function (actionName, setName, force) {}

    If (this.checkLoadedSets (SetName) |) (force === true)) {

    app.doScript (actionName, setName);

    Returns true;

    } else {}

    If (typeof this.debugLevel! = "undefined" & this.debugLevel = true) {}

    Alert ("ActionManager: the game '" + setName + "' is not found only currently loaded.");

    }

    Returns false;

    }

    };

    this.removeSet = {function (setName)}

    var errorFlag = false;

    {while(!errorFlag)}

    try {}

    app.unloadAction (setName, "");

    } catch (e) {}

    errorFlag = true;

    }

    }

    var arr = [];

    var nm;

    for (var i = 0; i)< this.currentloadedsets.length;="" i++)="">

    NM = this.currentLoadedSets [i];

    If (n! = setName) {}

    arr.push (nm);

    }

    };

    this.currentLoadedSets = arr;

    };

    };

    /* ========================================================================================= ======================= */

    selectedItems var = app.activeDocument.selection;

    Legends of var = [];

    var artItem;

    for (var i = 0; i)

    If (. layer.name selectedItems [i] == "Copy DRT") {}

    cutLines.push (selectedItems [i])

    selectedItems [i] .selected = false;

    } else {}

    artItem = selectedItems [i];

    }

    }

    for (var e = 0; e

    var cLeft = deforested .the [e];

    var ICPPA = captions [e] .top;

    offsetX = slot var - artItem.pageItems [0] .left;

    offsetY = ICPPA var - artItem.pageItems [0] .top;

    $.writeln ("X:" + offsetX + "Y:" + offsetY);

    App.Copy ();

    var actionString =]

    "/ version 3.

    "/ name [8."

    "4d6f76654974656d,"

    "]",

    "/ isOpen 1."

    "/ actionCount 1."

    ' / action-1 {', '.

    "/ name [8 ', '.

    "6d6f76654974656d,"

    " ]",

    "/keyIndex 0",.

    "/colorIndex 0",.

    "/isOpen 1".

    "/eventCount 1".

    "/ event-1 {", "

    "/ useRulersIn1stQuadrant 0",.

    "/internalName (adobe_move)."

    "/localizedName [4", '.

    "4d6f7665,"

    " ]",

    "/isOpen 0",.

    "/isOn 1".

    "/hasDialog 1".

    "/showDialog 0",.

    "/parameterCount 3",.

    "/ parameter-1 {", "

    "" / 1752136302 key ",

    "/showInPalette - 1", ".

    "/ type (actual unit)."

    "/value" + offsetX, / / must be a decimal number at work

    '592476268/unit',

    " }",

    "/ parameter-2 {", "

    "" / 1987339116 key ",

    "/showInPalette - 1", ".

    "/ type (actual unit)."

    "/value" + offsetY,

    '592476268/unit',

    " }",

    "/ parameter-3 {", "

    "" / 1668247673 key ",

    "/showInPalette - 1", ".

    ' / type (boolean).

    ' / value 0 ",".

    " }",

    " }",

    "}"

    ] .join ("\n");

    var actionManager = new ActionManager();

    actionManager.loadSet (actionString, "MoveItem");

    actionManager.playAction ("moveItem", "MoveItem");

    actionManager.removeSet ("MoveItem");

    App.Paste ();

    artItem = app.activeDocument.selection [0];

    If (e + 1 == cutLines.length) {}

    If (confirm ("' did you affect this piece?")) {

    artItem.remove ();

    }

    }

    }

  • Rename the layer random script

    Hello, im trying to make a script to rename the layer like this:

    "anyname. RGB"in"RGB ";   "anyname. CMYK"to"CMYK. "

    I found a that rename, but only with the name of the layer exactly and I have a lot of layers with random names before the ".rgb".

    can someone help me figure out how to do?  THX

    Oh, it's easy. This script will get the name after the first point. If there is more than one point, then it will get only the name between the first and the second point.

    #target photoshop
    var doc = activeDocument;
    var counter = 0;
    countLayers (doc);
    
    function countLayers(p){
          for(var i=0;i1){curLayer.name = lName[1]}
                counter++
                try{if(!p.layers[i].kind){countLayers (p.layers[i])}}
                catch(e){}
                }
          }
    
  • Script to move a selection from the limits of spread?

    I have a document with a difference much larger than the content in the document.

    1-oversize-pasteboard.png

    I have another template file with a gap corresponding to the size of the limits of all selected objects. I need to open this template, paste the objects, that pasted selection of objects align to the top left of the spread (aka cardboard neighborhood or work?) and then export as a PDF and .eps.

    Due to a lot of confusion about various coordinate systems, my ideal would be not having to move what that at all, but have instead, the upper left corner of the pasted content aligned with the upper left of the spread, as it is glued. Paste or paste in place makes the content where I need them. The objects are too weak.

    2-contents-pasted-too-low.png

    Even if there is a solution to paste the information where it needs to go from the outset, I would like to know how make a difference compared to the visible work area (I think it is properly known as the spread, but more commonly referred to as the mount table?) I want to just make sure I ask my question correctly so my intentions are understood).

    My first test with the following line of code produces the result seen in the next picture; only the background .eps object is moved, and it moves down.

    App.Selection [0]. Move([MyPage.Bounds[0]+myMargins.Top,MyPage.Bounds[1]+myMargins.Left]);

    3-first-try-to-move.png

    My second test is shown below; It seems also only reposition the background image, but something moved too far down and to the right. It seems that it may be of the same size and shape, like spread which I copied objects. The limits of selection have the right size when I stuck first the object in the new document, until the line of code to change the geometric limits has been executed.

    App.Selection [0] .geometricBounds = [myPage.bounds [0] + myMargins.top, myPage.bounds [1] + myMargins.left, myPage.bounds [2] - myMargin s.bottom, myPage.bounds [3] - myMargins.right];

    4-2nd-try-to-move.png

    Also, previous attempts (until I added the image of the Tiger, the text to its immediate left and a red rectangle behind the Tiger) saw all objects selected EXCEPT the background .eps image move upward and in the right position using app.selection [0] .geometricBounds.

    Any help would be greatly appreciated. Here is the code and a screenshot of the objects on the layer that are involved.

    indesign #target - 11.064 / / CC 2015

    myDoc = app.activeDocument;

    myPages = app.activeDocument.pages;

    myActivePage = app.activeWindow.activePage;

    // 1. Select and copy everything on this document activePage

    App.Select (SelectAll.All);

    App.Copy ();

    // 2. Open the template file and paste

    whichExportTemplate = "FCILG";

    myTemplateFolder = ' / Users/user/Documents /!  "Resources / models / Ted signs / Tags ';

    sFileName = myTemplateFolder + "/" + whichExportTemplate + ".indd".

    sFileName = sFileName.replace (/ % 20/g, "'" ");

    newDoc = app.open (File (sFileName));

    app.pasteInPlace ();

    App.Select (SelectAll.All);

    // 3. POSITION IT

    var myPage = myActivePage;

    var myMargins = myPage.marginPreferences;

    App.Selection [0] .geometricBounds = [myPage.bounds [0] + myMargins.top, myPage.bounds [1] + myMargins.left, myPage.bounds [2] - myMargin s.bottom, myPage.bounds [3] - myMargins.right];

    App.Selection [0]. Move([MyPage.Bounds[0]+myMargins.Top,MyPage.Bounds[1]+myMargins.Left]);

    // 4. Save the new file

    // 5. Close

    5-layers.png

    Would you mind bringing together all elements of the page on the page, you have a single object to process after duplication (I prefer duplicate() on app.copy () / app.pasteInPlace ()) without selecting anything? Just answer has all the elements of the page on your source page to add a group and manage this unique group object.

    Quick and dirty:

    //TWO InDesign documents are open
    //The SOURCE document is the ACTIVE one
    
    var myTargetDoc = app.documents[1];
    
    myTargetDoc.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;
    myTargetDoc.zeroPoint = [0,0];
    
    //Group everything on the active page of your SOURCE document:
    var myActivePage = app.layoutWindows[0].activePage;
    var myGroup = myActivePage.groups.add( myActivePage.pageItems.everyItem().getElements() );
    
    //Target the second document for the duplicate of the group:
    var myDuplicate = myGroup.duplicate(myTargetDoc.pages[0]);
    
    //Move the duplicate:
    myDuplicate.move([0,0]);
    
    //Tidy up a bit:
    myDuplicate.ungroup();
    myGroup.ungroup();
    

    Hope, that helps.

    Uwe

Maybe you are looking for

  • Pilot missing Balckberry 9800 for my smartphone.

    Original title: Balckberry 9800 device driver. I am running windows 7, but cannot associate my BB 9800 properly, because of a pilot missing for my smartphone. Pls help!

  • What is a "group"?

    When I go into any thread, at the top right, I see two things I'm not clear. A link that says ""Group add to Favorites " " A drop down menu that says ""subscribe to the activities of the group " " What is the significance of these? A search with thes

  • Communication I/O Stream socket operations

    Hello! I want to build a mechanism that opens a socket on a server connection and then independently send and receive messages to and from the server on this connection. My approach is like this: main thread I run a wire (ignition wire) which opens a

  • 2 Smartphones blackBerry - RIM messages and synchronization problem problems

    Hi all I am to place charge of RIM building messages in my Inbox (on the device and portable computer) and they advise me not to move the delet etc. and that the server will process with them (which is clearly not)... what I would do. My pocket compu

  • Every time using the ', it displays "and «»

    original title: why is my ' button always keep changing? A simple problem I guess, but as a writer, it is very annoying.  Whenever I'm trying to use the ', it displays "and" "when I hold down the SHIFT key.  I have to delete the extra apostrophe to a