Moving elements of an active document template file

Hi all

What I am trying to do is let open a template file and I'll have to go to this really quick file and copy what I have selected in this file, go back in the file, I am currently working, so I'll use an action that will stick in the right place. I was wondering if a script could copy what I chose in my template file and paste it into my file active, so I won't even leave my active folder. Here's what I have so far.

model var = app.documents.getByName ("sig.ai");

var tempSelected = template.selection;

var app.activeDocument = docRef;

If (tempSelected.length > 0) {}

for (i = 0; i < tempSelected.length; i ++) {}

newItem = tempSelected [i] .duplicate (docRef,

ElementPlacement.PLACEATEND);

}

}

else {}

Alert ("Please select one or more objects of art in your temp file");

}

It does not work, I just get the alert message, unless my model is my file active, which is not good. Don't know if it's possible to do I struggle to find scripts that involve files other than the active file so I'm not sure that anything is capable. Thank you for taking the time to look at this for me I really appreciate it. I tried messing around with insertion of files, but it isn't changed enough for me to use.

the name of all of your items in the model, then you can get a reference to them in your active document without having to select

var thisDoc = app.activeDocument;
var template = app.documents[1];
var itemToDuplicate = template.pageItems['namedItem'];
itemToDuplicate.duplicate( thisDoc, ElementPlacement.PLACEATBEGINNING );

Tags: Illustrator

Similar Questions

  • How to print ONLY the active document?

    Whenever I go to file/print program PSE 9 darn all working files sends in the tray of the printer. I searched online for 2 hours, now looking for an answer.

    I enjoy working with several to several files in the 'bin' and prefer to print only the active file, I am currently working on without having to close the "working files" before I can print. How can I print ONLY the active document or file in the location of project? Please help, I upgraded from PSE 3 PES 9 and really like the updated features, but what a pain in the neck by default becomes the best of me.

    Select it in the trash before calling to the top of the print window. If nothing is selected, everything happens in the print window.

  • File name of the active document

    Hello friends,

    Now that I managed to find quotes (special strings) in paragraphs, notes, tables and table notes - all with your generous help - I need to know the name of the file (path) of the current document (or book).

    All I've found is how to get the name of an element of the book file (finally that I need too, but later).

    How can I find the file name of the active document (which is not part of a book) and

    How can I find the file name of the current book?

    Thanks again for your help

    Klaus

    Friends,

    Suddenly, I found the answer (research in the reference of the oject for 'Filename' rather than 'file name' - 'path' in the FDK reference):

    alert ("Now processing book\n"+ app.ActiveBook.Name);
    alert ("Now processing document\n"+ app.ActiveDoc.Name);
    
  • I just bought a new Mac and they moved all my apps and documents.  When I open a document, he asked me to reactivate it I did.  Activation is successful.  The docuem == lying I'm working on a all text in black, but in the backgroun fishing shaded

    I just bought a new Mac and they moved all my apps and documents.  When I open a document, he asked me to reactivate it I did.  Activation is successful.  The docuemment I am train has all text in black, but in the background shaded peach.  How can I get all the text in a shaded background (white)?

    You work with a missing font...

  • How do I get the content from another file and paste it into the active document instead of certain string?

    I am newbie in indesign scripting of animals. So I apologize because I couldn't post my essays.

    Objective:
    I have a .indd document which will be a figure of legend, label etc. I need to copy the content (a figure that is editable) else file indd of this document where the tag figure exists.

    For example:
    Sample.indd

    Some text Fig.1.1 caption some text 

    I need to copy the contents of figure1.indd and paste in the document sample.indd where Fig.1.1 string exist and so forth. Now I do it manually. But am supposed to automate this process.

    So, I need some hint how to do it using extendscript?

    I found something like below, to do so, but I have no idea to develop it further and also do not know if this approach is correct my results. Please help me

    myDocument=app.open(File("file.indd"),false); //opening a file to get the content without showing.

    myDocument.pages.item(0).textFrames.item(0).contents="some text"; //here I could set the content but I don't knw how to get the content

    // ?????? Then I have to paste the content into active document.

    Try this test nicely to your and end, hope this will help you.

    var myDoc = File("/D/Sample.indd");//Figure File
    var myFigDoc = File("/D/Figure.indd");//Destination File
    app.open(File(myFigDoc));
    app.activeDocument.pageItems.everyItem().select();
    myObj = app.selection;
    var myGroup = app.activeWindow.activePage.groups.add(myObj);//Grouping the objects
    myGroup.select();
    app.copy();
    app.open(File(myDoc));
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.findWhat = "Fig 1.1";//Figure caption text
    app.findGrepPreferences.appliedParagraphStyle = "FigureCaption";//Figure Caption Style
    myFinds = app.activeDocument.findGrep();
    for(var i=0;i		   
  • How to get the file name of the current active document in InDesign CS4?

    Hello

    If I open a document in the file-> open, I can get the file name of the document using IOpenedFileInfo-> GetOpenedFilePath().

    But, if I create a new document and run the file-> save as, GetOpenedFilePath is invalid back reference IdFichier.

    What is the right way to get the file name of the active document?

    Thank you

    VSP

    You can try this:

    IDatabse * db =: GetDatabase (theDoc);

    IdFichier * SYSIXCOL = db-> GetSysFile();

    PMString docName is SYSIXCOL-> GetFileName();.

    Good luck

  • Active document needs to move from one place

    Hello

    When I open the file in the original location this file need to move around the office. When the file has been moved to the file location Original must be remove.

    File must be moved to a place to another place.

    Please help me.

    sasientry wrote:

    Yes JJMACK

    I need a script in photoshop for mac and pc.

    When I open the file in photoshop after I run active document of the script must record in my office but I do not need the source file when I open this file must fade

    For the script works on both platforms, then you must write it in java script.  Retrieve the full path of the file with the active document assocated in a file with a name like currentFile variable something like this

    try {}

    var test = app.activeDocument.fullName.displayName;

    } catch (e) {}

    Alert ("error, file not saved.");

    };

    If {(test)

    var currentFile = new queue (app.activeDocument.fullName.fsName);

    ...

    then save the document to your desktop "~ / desktop /" + newFile

    After this deletion of original file with

    ...

    currentFile.remove ();

    }

    else {save the document to the Office}

  • Can't backup windows because Backup has encountered a problem during backup of the C:\Users\marcel\Documents\Youcam file. Error: (the system cannot find the specified file. (0 x 80070002))

    can not backup windows because: Backup has encountered a problem during backup of the C:\Users\marcel\Documents\Youcam file. Error: (the system cannot find the specified file. (0 x 80070002))
    Backup has encountered a problem during backup of the C:\Users\marcel\Documents\Youcam file. Error: (the system cannot find the specified file. (0 x 80070002)).

    Maybe it's because I disabled the camera to prevent other people using the computer?

    [Moved from comments]

    Hi Marrcel,

    Thank you for keeping us posted.

    The issue can be due to turning the camera off. I suggest you to activate the camera and try.

    Please come back for any clarification on this or any issue of Windows. We will be happy to help you.

  • How to get active Document?

    UIDRef docUIDRef = GetDocumentUIDRef (widget); Result: fDB = 0x05ccc310, fID = 1

    InterfacePtr < IDocument > document (docUIDRef, UseDefaultIID());

    Happen error:

    __vfptr = CXX0030: error: expression cannot be evaluated

    But I opened the file in the sdk, it's ok.

    IdFichier fSysFile;

    FileUtils::PMStringToIDFile ("D:\\test.indd", fSysFile);

    SDKLayoutHelper layoutHelper;

    UIDRef docUIDRef = (fSysFile) layoutHelper.OpenDocument;

    InterfacePtr < IDocument > document (docUIDRef, UseDefaultIID());

    How to get active Document?

    Thank you

    You can use the ILayoutUIUtils to get a reference to the current document. The code would be as below

    iDocument * iDoc = Utils()-> GetFrontDocument();

    -Manan

  • Difficulties to create a Web page based on my own template file.

    Hello

    I'm a newbie to Dreamweaver, and I encounter a difficulty to create Web pages based on my model.

    In fact, I've saved a .dwt file in the same site.

    However, I don't find the template file when I open a new document.

    Is the .dwt file located in the Templates subdirectory?

  • Save as - name of the active document

    Does anyone know how script backs up new name of file with Javascript for Photoshop?

    I can save the file under a new name, but it does not replace the current active document that it records since. The current active document still has the old name.

    saveFile = new File (filePath () + "/" + fileName ())

    saveOptions = new PhotoshopSaveOptions();

    saveOptions.layers = true; Preserve layers.

    saveOptions.embedColorProfile = true; Keep the color profile.

    saveOptions.annotations = true; Keep annonations.

    saveOptions.alphaChannels = true; Preserve alpha channels.

    saveOptions.spotColors = true; Preserve spot colors.

    app.activeDocument.saveAs (saveFile, saveOptions, true, Extension.LOWERCASE);

    $.writeln (savefile);

    app.activeDocument.saveAs (saveFile, saveOptions, true, Extension.LOWERCASE);

    If you set it to 'true' to 'asCopy' (the third property) the behavior seems to be as expected.

  • Get the path of the active document from Photoshop

    It works in Photoshop and Bridge script (Javascript)

    var myPath = activeDocument.name;

    Tester.PSD

    This only works in Photoshop script (JavaScript), but not in the bridge.

    var ProcessFolder = activeDocument.path

    actually stops the script, without error or warning.

    How can I get the path to the file in the active document in Photoshop through Bridge?

    Thank you!

    Hello

    You can use BridgeTalk to communicate between applications

    In this case, there is the code and you must run it from the bridge to get the information you need for photoshop:

    // run this from Bridge to get the path of the active document
    // if photoshop is not running, it gives that message
    // if photoshop is Busy, it gives that warning
    // if photoshop has any images opened, it avoids getting the path and warn you
    
    pathFromPS();
    
    function pathFromPS() {
        var bt = new BridgeTalk;
        bt.target = "photoshop";
        bt.body = '(app.documents.length > 0) ? app.activeDocument.path : "No active images";';
        bt.onResult = function (resObj) {
            activePath = resObj.body;
        }
        if (BridgeTalk.getStatus (bt.target) == 'IDLE') {
            bt.send(3);
        } else {
            activePath = (BridgeTalk.isRunning(bt.target)) ? "[Busy]" : "[Not Running]";
        }
        return activePath;
    }
    
  • Digitally sign all Signature fields in the Active Document

    I have a script that will sign a unique digital signature with the name of the field field.

    I need to see the script so that it will sign in fields many/any signature in the active document without having to put the name of the field in the script, as domain names vary with each document.

    Can someone advise please how do I change the script to sign all the fields in the active document, regardless of the domain name?

    function myOtherTrustedFunction()
    {
    app.beginPriv ();
    Get and connection to the Security Manager

    var oSigHdlr = security.getHandler ("Adobe.PPKLite");
    oSigHdlr.login ("123", "/ c/Documents and Settings/name/Application Data/Adobe/Acrobat/10.0/Security/FirstNameLastName.pfx");

    Signature properties configuration

    chk var = this.getField ("Checked");
    If (chk! = null) {}

    Apply the Signature and store it in the original file

    bRtn var = chk.signatureSign ({oSig:oSigHdlr, bUI:false, oInfo: {password: "123"}});
    }

    app.endPriv ();
    }

    Any help will be most appreciated.

    How about this:

    var myEngine = security.getHandler("Adobe.PPKLite");
    myEngine.login("123", "/c/Documents and Settings/name/Application Data/Adobe/Acrobat/10.0/Security/FirstNameLastName.pfx");
    
    for (var i = 0; i < numFields; i++) {
    
        // Get the current field object
        var f = getField(getNthFieldName(i));
    
        // If it's a signature field and not already signed, sign it
        if (f.type === "signature" && !f.value) {
    
            // Sign the field
            f.signatureSign(myEngine, {password: "123"});
    
        }
    }
    
  • .PNG footer CSS disappears when I create the new template file

    I have a .png background image in my CSS footer which immediately disappears when I create a new template file. If I just save the template in the .html file, it works fine, but defeated the purpose of the model. the .gif in the sidebar CSS is implemented in exactly the same way and works very well.

    Here's the CSS to the template:

    .twoColFixLtHdr #footer {
     background:#768E90;
     padding-top: 12px;
     padding-right: 30px;
     padding-bottom: 0;
     padding-left: 0px;
     background-image: url(../Images/kc-png-footer.png);
     height: 62px;
     background-repeat: no-repeat;


    Here is the CSS of the .htm file that is created from the template:

    .twoColFixLtHdr #footer {
     background:#768E90;
     padding-top: 12px;
     padding-right: 30px;
     padding-bottom: 0;
     padding-left: 0px;
     background-image: url(Images/kc-png-footer.png);
     height: 62px;
     background-repeat: no-repeat;


    The two direct file links are below:


    Here is the page that was created when I went File > New > from the model (notice it is no white .png background image in the footer):
    http://www.kidscountpeds.NET/01-KCP-from_template.html

    Here is the page saved as .htm to the .dwt file model (note the background image of white footer with RADIUS corners, that's what I'm trying to accomlish with model): http://www.kidscountpeds.NET/01-KCP-template.htm

    Any help would be greatly appreciated.

    According to the code you show, DW does exactly what it should be done (assuming the child page is at the top level of the site).  But when I browse the site and look at the code, I see that there are several links that are broken.

    {.twoColFixLtHdr #sidebar1}
    float: left; / * because this element is floating, it takes a width * /.
    Width: 200px; / actual width of this div, in browsers comply with the standards, or the standard mode of Internet Explorer includes the padding and border in addition to width * /.
    background: #d0e4a6; / * the background color will be displayed for the length of the content of the column, but no further * /.
    padding: 0px 10px 15px 20px;
    background-image: url (file:///C|/Websites/Kids Count/Images/kc-mc-background.gif);
    background-repeat: no-repeat;
    height: 420px;
    }

    ...

    .twoColFixLtHdr #footer {}
    background: #768E90;
    padding-top: 12px;
    padding-right: 30px;
    padding-bottom: 0;
    padding-left: 0px;
    background-image: url (file:///C|/Websites/Kids Count/Images/kc-png-footer.png);
    height: 62px;
    background-repeat: no-repeat;
    }

    Obviously, a link to an image on your hard drive will not work on the web.

    What you have in the field of Local site root folder in your site definition?  Is - this - C:\Websites\Kids County?  What happens when you open the child page and apply the template directly on it with MODIFY | Models > model apply to the page...?  Is the CSS code on this aspect of the page as I have shown above?

  • "There was an error opening this document, the file is damaged and could not be repaired." by e-mail

    I get "there was an error opening this document, the file is damaged and cannot be repaired." Sometimes it works, but more often than not I get this message when you try to open a PDF well my IMAP email server. I also have the latest player adobe downloaded on my computer and I have run Norton 360, which is to day saying my computer is free from any malicious dishes. Help, please!

    Hello ErikAtkinson,

    You can try saving the PDF file on your desktop before trying to open it.
    See if that helps with corruption problems.

    If this isn't the case, then I suggest that you post in the forums Adobe for Adobe Reader. I have included a link below:
    http://forums.Adobe.com/community/adobe_reader_forums

    They better be able to help with their product.

    Sincerely,

Maybe you are looking for

  • Cancel delete photos on icloud do not work

    After trying to reduce the amount of photos and it make no difference in the amount of storage icloud, I pressed the clear pictures on the button manage, icloud, system preferences and then realized that it would remove all my photos. So I tried clic

  • Office Air iPad darkens but I can still hear Siri and other screens work.

    iPad 32GB I can't get the air desktop.  I can hear Siri, but the screen is black.  I can get other screens via Safari but I can't access or see my apps.

  • S2716DG revision A00/A01/A02, an Xbox, HDMI does not

    Hello I bought the S2716DG Dell Sunday and it was delivered yesterday. Once in place, I noticed that there is no HDMI response. The monitor detects that there is a HDMI in there that I can change the Miniport HDMI input and vice versa, but when HDMI

  • File bar signature key

    Weather code key we have for signature BlackBerry devices works also for applications of Table? Or is it a new code signing key? Thanks in advance.

  • BlackBerry blackberry sync with Google apps Smartphones

    I have a BB Curve 9300 software v.  6.0.0.526 I have a name/DNS/MX with a domain registrar - Let's say my registered name is companyone.com I have a Google Apps (free) - with the field companyone - account and various users associated with thatname s