Moving items from a template file to active document

Hello Everyone,
What I am currently doing is I will leave a template file open and I will have to go to that file really quick and copy what I have selected in that file, go back to the file I am currently working on, then I will use an action that will paste it in the correct place. I was wondering if a script could copy what I have selected in my template file and paste it into my active file so I won't even have to leave my active file. Here is what I have so far.
var template = app.documents.getByName ("sig.ai");
var tempSelected = template.selection;
var docRef = app.activeDocument;
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 art objects in your temp file" );
It is not working, I just get the alert message, unless my template is my active file too, which does me no good. Not sure if this is possible to do I have trouble finding scripts that involve files other than the active file so I am not sure what all is capable. Thanks for taking the time to look at this for me I really appreciate it. I tried messing around with placing files but it is not editable enough for me to use.

Hi djbgraphicdesign,
please try this:
if (documents.length == 2) {
    // your template should be the active document and one item should be selected (as minimum)
    // a second document should be opened in the "background"
    var template = app.activeDocument;
    var tempSelected = template.selection;
    var anotherDoc = app.documents[1];
    if ( tempSelected.length > 0 ) {
        for ( i = 0; i < tempSelected.length; i++ ) {
            newItem = tempSelected[i].duplicate( anotherDoc, ElementPlacement.PLACEATEND );
        alert (i + " items duplicated");
        //app.activeDocument = anotherDoc;
        } else {
            alert( "Please select one or more art objects in your temp file" );
Have fun

Similar Messages

  • Reference application item from page template

    Hi friends,
    How can refere to application item from page template (i.e. one level tab).
    set or get value from application item.
    thank you

    Alaa,
    If the item name is X put &X. in the template. Don't forget to use upper case and provide the trailing period.
    set or get value from application item.
    That is not a complete sentence, please clarify.
    Scott

  • BAPI to upload line items from a flat file to VA01

    Hi guys,
    I have a requirement wherein i need to upload data containing line items from a flat file to VA01.Please tell me how do i go about this.
    Thanks and regards,
    Frank.

    Hi
    Frank this code might help u and this is the BAPI to create sales document BAPI_SALESDOCU_CREATEFROMDATA1 if i am helpful to u in any way plzz reward and dont forget to reward me plzzz
    for any further quiries my mail id [email protected]
        Include           YCL_CREATE_SALES_DOCU                         *
         Form  salesdocu
         This Subroutine is used to create Sales Order
         -->P_HEADER           Document Header Data
         -->P_HEADERX          Checkbox for Header Data
         -->P_ITEM             Item Data
         -->P_ITEMX            Item Data Checkboxes
         -->P_LT_SCHEDULES_IN  Schedule Line Data
         -->P_LT_SCHEDULES_INX Checkbox Schedule Line Data
         -->P_PARTNER  text    Document Partner
         <--P_w_vbeln  text    Sales Document Number
    DATA:
      lfs_return like line of t_return.
    FORM create_sales_document changing P_HEADER  like fs_header
                                       P_HEADERX like fs_headerx
                                       Pt_ITEM   like t_item[]
                                       Pt_ITEMX  like t_itemx[]
                                       P_LT_SCHEDULES_IN  like t_schedules_in[]
                                       P_LT_SCHEDULES_INX like t_schedules_inx[]
                                       Pt_PARTNER  like t_partner[]
                                       P_w_vbeln  like w_vbeln.
    This Perform is used to fill required data for Sales order creation
      perform sales_fill_data changing p_header
                                       p_headerx
                                       pt_item
                                       pt_itemx
                                       p_lt_schedules_in
                                       p_lt_schedules_inx
                                       pt_partner.
    Function Module to Create Sales and Distribution Document
      perform sales_order_creation using p_header
                                         p_headerx
                                         pt_item
                                         pt_itemx
                                         p_lt_schedules_in
                                         p_lt_schedules_inx
                                         pt_partner.
      perform return_check using p_w_vbeln .
    ENDFORM.                                 " salesdocu
        Form  commit_work
        To execute external commit                                    *
    FORM commit_work .
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
       WAIT          = c_x
    ENDFORM.                                 " Commit_work
    Include ycl_sales_order_header          " To Fill Header data and Item data
    Include ycl_sales_order_header.
         Form  return_check
        To validate the sales order creation
    FORM return_check using pr_vbeln type vbeln.
    if pr_vbeln is initial.
        LOOP AT t_return into lfs_return .
          WRITE / lfs_return-message.
          clear lfs_return.
        ENDLOOP.                             " Loop at return
      else.
        perform commit_work.                 " External Commit
        Refresh t_return.
        fs_disp-text = text-003.
        fs_disp-number = pr_vbeln.
        append fs_disp to it_disp.
      if p_del eq c_x or p_torder eq c_x or
        p_pgi eq c_x or p_bill eq c_x.
        perform delivery_creation.           " Delivery order creation
        endif.                               " If p_del eq 'X'......
      endif.                                 " If p_w_vbeln is initial
    ENDFORM.                                 " Return_check
    *&      Form  sales_order_creation
          text
         -->P_P_HEADER  text
         -->P_P_HEADERX  text
         -->P_PT_ITEM  text
         -->P_PT_ITEMX  text
         -->P_P_LT_SCHEDULES_IN  text
         -->P_P_LT_SCHEDULES_INX  text
         -->P_PT_PARTNER  text
    FORM sales_order_creation  USING    P_P_HEADER like fs_header
                                        P_P_HEADERX like fs_headerx
                                        P_PT_ITEM like t_item[]
                                        P_PT_ITEMX like t_itemx[]
                                        P_P_LT_SCHEDULES_IN like t_schedules_in[]
                                        P_P_LT_SCHEDULES_INX like t_schedules_inx[]
                                        P_PT_PARTNER like t_partner[].
        CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
        EXPORTING
          sales_header_in     = p_p_header
          sales_header_inx    = p_p_headerx
        IMPORTING
          salesdocument_ex    = w_vbeln
        TABLES
          return              = t_return
          sales_items_in      = p_pt_item
          sales_items_inx     = p_pt_itemx
          sales_schedules_in  = p_p_lt_schedules_in
          sales_schedules_inx = p_p_lt_schedules_inx
          sales_partners      = p_pt_partner.
    ENDFORM.                    " sales_order_creation

  • Moving items from sub-folder to inbox are disappearing

    Hello everyone, 
    We have exchange 2010 and we are having issue when user move item from sub-folder to inbox then the item just disappears. I have tested this at-least 3 mailboxes. 
    If i do this in outlook then it disappears right away. if i do this in OWA then it disappears in 10 seconds.  Sometimes it shows up in deleted folder but most of the time it doesn't but it always shows up in "recover deleted item" in outlook.
    Please advise how to find what's going on. thanks 

    I don't think it is a Managed Folder Mailbox Policy which is doing this. We have almost ruled out that the issue is specific to Client but not Server. If you want to check the Managed Folder Mailbox Policy for a mailbox run the command below:
    Get-Mailbox -ResultSize Unlimited -Server ServerName |?{$_.ManagedFolderMailboxPolicy -ne $Null}
    The above command will help us get all the mailboxes where there is a ManagedFolderMailboxPolicy Applied
    To Get the ManagedFolderMailboxPolicy for a Specific Mailbox Run the command below:
    Get-Mailbox MailboxName | Fl Name,DisplayName,ManagedFolderMailboxPolicy
    If Deleting the outlook profile/ost fixed the issue, then it might have been most likely an issue with corrupted outlook rule. if you want to do it for all the mailboxes across org, i would suggest you force that via group policy using a PRF File.
    M.P.K ~ ( Exchange | 2003/2007/2010/E15(2013)) ~~ Please remember to click “Vote As Helpful" if it really helps and "Mark as Answer” if it answers your question, “Unmark as Answer” if a marked post does not actually answer your question. ~~ This
    Information is provided is "AS IS" and confers NO Rights!!

  • Page numbers from deleted book file persist in document

    I have 4 documents that I needed to merge so I attempted to put them in a book file (which I am not at all familiar with how to use). I removed the documents from the book file because it was not doing what I needed it to do, but the auto section page numbers are persisting in the individual documents and I cannot get rid of them. For example I have page numbering starting on page 5, but pages 1-4 have page numbers 5-8 on them and I cannot get rid of them. (I can do this manually of course but would like to know why they are persisting)

    Do you mean the numbers physically appear on the pages and you don't want them there (if so, delete them from the master page(s)) or do you mean the numbering scheme is wrong (if so, check your section and numbering options)?

  • Exchange 2010 SP2 : Move calander entries and Task items from Archive mailbox to current active mailbox.

    Hi,
    After upgrade the exchange 2010 SP1 to SP2, all users calendar and task items entries also moved to archive mailbox from user's active mailboxes.
    We like to move 90 days older emails to archive mailbox but not calendar & task items to be moved.
    Any solution to move back those older archive calendar and task items to active mailbox users and also any settings to stop further to move calendar & task items to archive mailbox in SP2?
    Thanks
    MD

    Hi,
    Exchange 2010 SP2 RU4 added support for Calendar and Task Retiontion polices. For more information about that see the below blog post which also includes a workaround if you don't what these folders to be processed by MRM.
    Calendar and Tasks Retention Tag Support in Exchange 2010 SP2 RU4
    http://blogs.technet.com/b/exchange/archive/2012/08/14/calendar-and-tasks-retention-tag-support-in-exchange-2010-sp2-ru4.aspx
    PS. Exchange 2010 SP2 is no longer supported.
    Martina Miskovic

  • Populate DB after moving item from right panel to left panel of shuttle

    Refer to the following forum: Re: APEX 4.1 - Populate DB based on right panel of shuttle
    Refer to the following apex app: http://apex.oracle.com/pls/apex/f?p=27554:51
    Login: demo
    PW: demo
    APEX version: 4.1.1.00.23
    Oracle 11g
    What do I need to add to the page process that when shuttle items are moved from the right panel back to the left panel, 'null' is assigned to the 'Analyst' column of the DB table?
    My current page process updates the DB table column 'DQ_ANALYST' with the name in the select list based on the items in the right panel of the shuttle. (Again see the previous thread: Re: APEX 4.1 - Populate DB based on right panel of shuttle
    declare
        tab apex_application_global.vc_arr2;
        l_count number;
    begin
        tab := apex_util.string_to_table (:P51_SHUTTLE);
        for i in 1..tab.count
        loop
        select count(*) into l_count from DQ_MANUAL_EDIT WHERE DQ_ATTRIBUTE = tab(i);
         if l_count > 0 then
           UPDATE DQ_MANUAL_EDIT
           SET DQ_ANALYST = :P51_DQ_ANALYST
           WHERE DQ_ATTRIBUTE = tab(i);
        end if;
        end loop;
    end;DB table (before clicking button):
    Field                          Analyst
    Co-Borrower Credit Score       Analyst_1
    Appraised Value               Analyst_1
    Appraisal Identifier          Analyst_1When 'Appraised Value' and 'Appraisal Identifier' are moved from the right panel back to the left panel and the 'Apply Changes' button is clicked, I am wanting the 'Analyst' column to be updated with 'null'.
    DB table (before clicking button):
    Field                          Analyst
    Co-Borrower Credit Score       Analyst_1
    Appraised Value               (null)
    Appraisal Identifier          (null)Here is my test code:
    declare
        tab apex_application_global.vc_arr2;
        l_count number;
    begin
        tab := apex_util.string_to_table (:P51_SHUTTLE);
        for i in 1..tab.count
        loop
        select count(*) into l_count from DQ_MANUAL_EDIT WHERE DQ_ATTRIBUTE = tab(i);
         if l_count > 0 then
           UPDATE DQ_MANUAL_EDIT
           SET DQ_ANALYST = :P51_DQ_ANALYST
           WHERE DQ_ATTRIBUTE = tab(i);
        end if;
    --Doesn't work but here is an example of what I am trying to accomplish
         if l_count > 0 then
           UPDATE DQ_MANUAL_EDIT
           SET DQ_ANALYST = null
           WHERE DQ_ATTRIBUTE <> tab(i);
        end if;
        end loop;
    end;

    I used the following code. First, I run an update statement setting the DQ_ANALYST to null where the DQ_ANALYST is equal to the select list field (:P51_DQ_ANALYST). Then based on what is currently on the right panel, set the DQ_ANALYST to what is in the select list field (:P51_DQ_ANALYST).
    declare
        tab apex_application_global.vc_arr2;
        l_count number;
    begin
        UPDATE DQ_MANUAL_EDIT
        SET DQ_ANALYST = null
        WHERE DQ_ANALYST = :P51_DQ_ANALYST;
        tab := apex_util.string_to_table (:P51_SHUTTLE);
        for i in 1..tab.count
        loop
        select count(*) into l_count from DQ_MANUAL_EDIT WHERE DQ_ATTRIBUTE = tab(i);
         if l_count > 0 then
                  UPDATE DQ_MANUAL_EDIT
                  SET DQ_ANALYST = :P51_DQ_ANALYST
                  WHERE DQ_ATTRIBUTE = tab(i);
        end if;
        end loop;
    end;

  • Moving item from library to Daily Shelf/Home page

    When I borrow a book from my local library it dowloads (through ADE) into my library "files".  I can access this book from my home page through the "more" drop down window but can't move it to my Daily Shelf.  Any suggestions?

    The first thing I would try is dropping the ics file onto the iCal icon, rather than double clicking it. If that doesn't work, open the ics file with Text Edit and see if you can fine where the calendar name is specified and change it.
    AK

  • CS4 timeline gets distorted when moving items from bin to timeline

    Hello everyone.I'm using Premier pro cs4 with windows vista ultimate 32 bit. when trying to move files from the bin into the  timeline the display gets distorted and multiply the timelines. Any advice? 

    More information needed for someone to help
    http://forums.adobe.com/thread/416679
    Some specific information that is needed...
    Brand/Model Computer (or Brand/Model Motherboard if self-built)
    How much system memory you have installed, such as 2Gig or ???
    Operating System version, such as Win7 64bit Pro... or whatevevr
    -including your security settings, such as are YOU the Administrator
    -and have you tried to RIGHT click the program Icon and then select
    -the Run as Administrator option (for Windows, not sure about Mac)
    Your Firewall settings and brand of anti-virus are you running
    Brand/Model graphics card, sush as ATI "xxxx" or nVidia "xxxx"
    -or the brand/model graphics chip if on the motherboard
    -and the exact driver version for the above graphics card/chip
    -and how much video memory you have on your graphics card
    Brand/Model sound card, or sound "chip" name on Motherboard
    -and the exact driver version for the above sound card/chip
    Size(s) and configuration of your hard drive(s)... example below
    -and how much FREE space is available on each drive (in Windows
    -you RIGHT click the drive letter while using Windows Explorer
    -and then select the Properties option to see used/free space)
    Windows Indexing is BAD http://forums.adobe.com/thread/676303
    While in Properties, be sure you have drive indexing set OFF
    -for the drive, and for all directories, to improve performance
    Some/Much of the above are available by going to the Windows
    Control Panel and then the Hardware option (Win7 option name)
    OR Control Panel--System--Hardware Tab--Device Manager for WinXP
    And the EXACT type and size of file that is causing you problems
    -for pictures, that includes the camera used and the pixel dimensions
    Plus Video-Specific Information http://forums.adobe.com/thread/459220?tstart=0
    Read Bill Hunt on a file type as WRAPPER http://forums.adobe.com/thread/440037?tstart=0
    What is a CODEC... a Primer http://forums.adobe.com/thread/546811?tstart=0
    What CODEC is INSIDE that file? http://forums.adobe.com/thread/440037?tstart=0
    Report back with the codec details of your file, use the programs below
    For PC http://www.headbands.com/gspot/ or http://mediainfo.sourceforge.net/en
    For Mac http://mediainfo.massanti.com/
    Once you know exactly what it is you are editing, report back with that information... and your project setting, and if there is a red line above the video in the timeline, which indicates a mismatch between video and project

  • How to select an item from a jspx file from a bean

    Hi all,
    I have a creation.jspx page that create / modify employee infos. I selected an employee from a table and then, I want to be able to modify some attributes. So, I need to enable a "save" button in the jspx page when I select an employee.
    I created a : +selectionListener="#{selectedColumn.t1_selectionListener}"+
    and a bean to control it:
    +package Bean;+
    +import org.apache.myfaces.trinidad.event.AttributeChangeEvent;+
    +import org.apache.myfaces.trinidad.event.SelectionEvent;+
    +public class selectedColumn {+
    +public selectedColumn() {+
    +}+
    +public void t1_selectionListener(SelectionEvent selectionEvent) {+
    *What code do I put in there to access a button element of the jspx page?*
    +}+
    +}+
    The button is in the page, *but not* in the component that calls this event.
    Thanks :)

    Hi Maxime.
    Easy way to achieve it:
    - Go to Property Inspector of your "save" button.
    - In Advanced -> Binding, create a binding to your button in your Backing Bean where is your selectedColumn method.
    - Now you have in your Backing Bean your button accesible and now you can enable or disable it with next code:
    this.myButton.setDisabled(false);
    AdfFacesContext.getCurrentInstance().addPartialTarger(myButton);Regards.

  • Calendar Items from Imported PST Files Cannot Be Modified

    I have a customer that had their 2008 DC crash with no backup.  They created a new AD domain with a new name with all the same users.  Then they exported all mailboxes as PST files and imported them into the recreated mailboxes.  Now, when
    trying to modify a calendar entry, they get a "Don't have permission" error.
    My research says this is a known problem that has to do with an incorrect LegacyExchangeDNS attribute.  It can be fixed by using the old AD's attribute and adding it as an X500 address on the new Domain.  Unfortunately, the old DC is toast.
    Any thoughts on how to fix this?
    Thanks!

    Hi,
    According to your description, I understand that all mailboxes are exported as PST files and imported to the new created mailboxes.
    The PST exporting and importing may lost some permission during New-MailboxImportRequest importing. Please use
    Microsoft Exchange Server MAPI Editor (MFCMAPI) tool to export calendar data and import it to new mailbox to have a try. Also check the Calendar permission for the Calendar folder:
    http://blogs.technet.com/b/outlooking/archive/2010/05/14/useful-tools-while-troubleshooting-outlook-issues-3-mfcmapi.aspx
    Additionally, here is a helpful KB:
    https://support.microsoft.com/en-us/kb/2783959
    Regards,
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]
    Winnie Liang
    TechNet Community Support

  • How do I recover a lost item from the note file?

    I lost one of my items on the "notes" app. How do I recover this item ?

    Try http://support.apple.com/kb/ht1766

  • Moving email from inactive account to an active account

    This month my ISP and main email provider ended email service and therefore my TB account for that IMAP email address is inactive. My TB has five other accounts and I would like to move email and folders to active accounts but it appears that I cannot. When I attempted to delete a folder in the inactive IMAP account but it seems that TB needs to connect to the ISP email server. How can I get TB to allow me to move the email and folders to another account?

    Garry how about starting your own thread with a few details including what Inactive account means to you. There is no reason to bring this thread back to life after 2 months.

  • Moving items from ipod to computer/itunes

    Can someone assist me? im having trouble. I want to know if i can move what music i have on my ipod, onto my computer. Or at least onto my library in itunes. Im not sure how to go about it. As i want to put all my music into library, back up music, then delete music off my ipod to start over!? Please help!

    Apple doesn't support the transferring of music from your iPod to your iTunes. Only iTunes to iPod. So to do this you will need to download a third party program that will help copy your music from your iPod back to your computer, or there are a couple manual methods you can check out.
    THIRD PARTY PROGRAMS
    iPod Access - Windows & Mac
    http://www.findleydesigns.com/index.html
    iPodCopy - Windows & Mac ( moves videos too)
    http://www.wideanglesoftware.com/ipodcopy/mac/index.html
    YamiPod - Windows & Mac
    http://www.yamipod.com/main/modules/home/
    PodUtil - Windows & Mac
    http://www.kennettnet.co.uk/software/podutil.php
    iPodRip - Windows only - Trial only
    http://www.thelittleappfactory.com/software/ipodripwin.php
    Manual Methods
    Windows only
    http://discussions.apple.com/messageview.jspa?messageID=797432
    How to get songs off of your Windows iPod - cnet
    http://www.cnet.com/4520-7899_1-6477981-1.html?tag=txt
    If your iPod is set to automatically update and you plug it into iTunes, a message will pop up telling you that your iPod is linked to another library. It will ask if you want to sync and replace all your music. Make sure you hit NO. If you sync with an empty library, then your iPod will also end up empty, because when it syncs it makes an exact copy of your library.
    Goodluck, hope something works for ya

  • Download items from Safari's Activity window DEAD OS X.7 Lion

    Downloading items from Safari's (5.1) Activity window DEAD- Mac OS X.7 Lion
    Aargghhh this was brilliant before for grabbing stuff and not working now,
    all i get is a massive amount of text showing up and no download anymore.
    Yup you can download an earlier version (5.0.6) but Lion will not swallow it
    tried pacifist to open the old package but even that fails.
    thought i could find it inside and run it.
    so....
    what now?
    is there a way round this?
    a third party plug in!
    something?
    anyone got any idea how to sort this out?
    so i can grab filmclips pictures etc...
    just like before.

    I thought I was the only person who was grieving the loss of this feature. I used it mostly for downloading PDFs as preview handles them so much better than shoddy propriety viewers, or even the "preview in safari" mode. During my degree it was invaluable to me as it also let me save these files into folders and keep them for referencing later.
    To further exlpain; it was one of the features which set Safari out from the rest. The activity window shows all the different elements of the website which are either being loaded or which have been downloaded. It will show elements of javascript, images, music, PDFs etc embedded in the page including videos and the like.
    Within that activity window, you can also see (and copy!) the DIRECT LINK address of each element of the page. ie: Where the actual media files are being hosted, downloaded or streamed from. Certain sites disable this feature for protected works, as they are entitled to do so, but the vast majority allow it.
    When we had a separate downloads window, instead of this overlay box in the Lion safari, it enabled the end user to copy the DIRECT LINK in the activity window using Ctrl + C and do the following:
    1) Either paste it into the address bar to watch/ listen to the media free from the other elements of the page which waste memory/ get in the way
    2) Paste it into the "Downloads" window (Using Ctrl + V) which would instantly start downloading the file, as if you had clicked a "Download file ABC Now" link on a web page.
    With the loss of the download window, only option 1 is available. This means that only images and certain formats of video/ audio will be viewable off the website in question ie: ones that quicktime can play. And the current version of quicktime embedded within safari doesn't give you the option to "Download a copy" or "Save as" like older versions used to.
    This may necessitate a revisiting of Firefox, which has a "Media browser" function.
    I wonder if there is perhaps a bookmarklet out there which forces a download of whatever is dragged onto it. Any ideas?

Maybe you are looking for

  • Iphone 6 photo image compression/ quality loss

    iPhone 6 and 6 plus have pretty remarkable cameras. But oddly, Apple doesn't seem to want you to keep the high quality images and videos you take. As soon as you email let's say a 3.5 mb photo image, you are asked what size you want to email it in an

  • How to handle advance button on LOV popup

    HI, I have implemented framework classes to get the handle of search button of inputlistofvalues pop up window. Now i want to perform advance search with different type of operator. Can anybody tell me how can i archive it. Thanks in Advance

  • Display fields

    hi all i need to display all the field from a table with search help. User can enter a table name in the input box1. Input box2 will display all the table fields using search help? What must i do ?

  • WEP encrypted network - can't connect

    I'm trying to use netcfg2.0.6 to connect to a WEP-encrypted network, but it doesn't work, with the error message: :: father up - Wireless association failed. [FAIL] I can correctly connect to a different wpa-encrypted network, so I'm assuming it's a

  • Park invoices that havent been Goods Receipted

    Dear Gurus, We are looking at a way of parking invoices on our system that havent been GRN'd but want to maintain Goods-Receipt-Based IV button ticked in the PO to ensure that the functionality around this are maintained. We also want to be able to a