How to keep anchor in middle while changing height and width for comp in extendscript?

When i try to change my composition height and width using extendScript, it works but with anchor point at top left corner. How do I maintain it at the center??
My code:
comp.width = 4000;
comp.height= 4000;
result:
expected:
Thank you

So you caught me on an open day, and I even dragged in another staffer (Josh) to sit and figure this out and we did. I just need to clean it up into a function for ease of use. It literally became an obsession between Josh and I to figure this problem out. We seriously need to get outside more, haha. I'll post the solution here shortly once it's cleaned.
Is there a way to access layer's properties like position, rotation etc without its comp open or selected and not knowing its item number.
Finding layers can be done by looping through all comps and all layers. You must set a series of matching criteria to compare against so you don't accidentally grab a duplicate layer that has the same values though. Usually the layer name, size or any property spec that is unique, source asset if it's an AVLayer, etc... It's also possible to have a list returned that you choose from if you wanna verify the layer before proceeding. All this has to be manually coded though.
var comp = app.project.activeItem;
var layer = comp.selectedLayers[0];
//assuming layer is a comp
layer.duplicate();
var num = layer.index;
var name = (layer.name + "_comp");
var newComp=  comp .layers.precompose([Lnum], Lname, true);
newComp.width =  4000;
newComp.height =  4000;
now what am trying to achieve is move the comp (layer) to the center of newComp i.e at 2000, 2000
I'm not fully understanding the process you are intending. You are searching for precomps (comps used as layers) basically?

Similar Messages

  • How to keep data in session while changing webshop in ISA 4.0?

    Hi All,
    I have one requirement in my current project. We are showing Webshops in "categoriesB2C.jsp" file in "left" side. We have four webshop as below.
    1) Shop By Market
    2) Shop By Product
    3) Shop By Quick Ship
    4) Shop By Price.
    I am hiding webshop in "Categories.jsp" selected in "shoplist.jsp" now when I put some product in shopping cart or I login in B2C. and then click on any link of webshop which I have provided in "categoriesB2C.jsp" I am using below link
    "<a href="/b2b_virco/b2b/init.do?shopId=PRODUCT">" around webshop name in "categoriesB2C.jsp" if I use
    <a href="/b2b_virco/b2b/readshop.do?shopId=PRODUCT"> then I am getting error.
    Now I want to preserve my selection while changing the webshop.  right now it is changing the webshop but it is not preserving the data in "cart" and if I am login then it just throw me out and reset my selection in shopping cart.
    Any idea or any help is a great help for me.
    Thanks.
    Ashish Patel.

    Dr. Iman, thanks, but I made your suggested change and the same result applies. I removed the "Close File" vi from the loop and even wired a "False" boolean variable to the "Close When" port of the "Write to C" vi. The results from previous loops are still being over-written by later loops leaving only one loop of data by the time the vi is finished running.
    Any other ideas? I have attached the latest version of the vi that I am working on this.
    Attachments:
    Traverse_Alive_Triple_Bypass.vi ‏140 KB

  • I have changed my Apple ID from an old email to a new one.  But It keeps coming up with my old email and asking for my old password. How do i stop this from happening and get it onto my new one?

    I have changed my Apple ID from an old email to a new one.  But It keeps coming up with my old email and asking for my old password. How do i stop this from happening and get it onto my new one?  Its on my Ipad and iphone 5, please help as its doing my head it

    How do you update it? Basically what has happened my password was disabled for "security reasons" on sunday (21/10/12), so i tried to reset it, but for some reason i couldnt get into my old email (probably because i havent used it for 2 years), so i read on here i could swap it to a new email that i currently use (which is what i have done) ive swapped everythin over to it (facetime, iCloud etc) but keeps coming up with old email and asking for password

  • I ripped all my CD's to a NAS (.wav). How to import those to iTunes while changing to AAC without loosing references (CD-Title)

    I ripped all my CD's to a NAS (.wav). How to import those to iTunes while changing to AAC without loosing references (CD-Title)

    You could try my script ConvertFormat and see if you like the results. Would be easier than inserting the CDs and correcting the tag info again. Just be aware this is a one-way trip. Once you've thrown away some quality to shrink the files you can't get it back without going back to the source. You may better off investing in a bigger drive.
    If you just want to squeeze more on the iPod you can use the built-in iTunes option to convert files to a lower bitrate as they are added to the device.
    tt2

  • If I completely fill my hard drive 500Gb how time machine will keep working having 1Tb of total space, I mean I have to delete mu hard drive but how I keep my previous information on time machine and keep using to with new information?

    If I completely fill my hard drive 500Gb how time machine will keep working having 1Tb of total space [externak hard drive], I mean I have to delete my hard drive but how I keep my previous information on time machine and keep using it with new information?

    Time Machine does not provide archival storage.
    If you delete a file from your disk it will eventually be deleted from your TM backup without any notice to you.
    You need a second external disk to use for archival storage.
    You also need a third disk for backups of the second disk.

  • How do you change/adjust border width for all the cells in a table created in Pages?

    How do you change/adjust border width for all the cells in a table created in Pages?
    Note- I am trying to figure out how to create and format tables in the latest version of the Pages app on an iPad air (iOS 8.1.1.1) . Creating tables, adding or removing borders for individual/all cells in a table seems straight forward. However the default border style seems to be a heavy black line. How do I change this?
    I found the option add or remove borders for all/ individual cells in a table, however I can't find any option within style/format dialogue screens for changing colour or line thickness for table cells. Likewise I can't find any clear instructions on how to do this in apple help pages or support website
    Btw- I'm assuming  it is possible to customize/adjust the colour & thickness of selected lines in a table created in this app (it's fairly easy to do this word processing apps like MS Word) please let me  know if this is not actually possible in Pages

    They know perfectly well what they took out of Pages '09.
    Well over 90 features.
    Do you think you posting feedback is going to remind them of what they did?
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Pages '09 should still be in your Applications/iWork folder.
    Archive/trash Pages 5 and rate/review it in the App Store, then get back to work.
    Peter

  • How to change the height and width of a control?

    Dear all,
    is there anyway to change the height and width of a control?
     In the property nodes, i am just able to read the bound values but cudnt write to it.
    How can i set the bound values for a control?
    Thanks,
    Ritesh

    Not all controls can be sized this way. For example to change the vertical size of a simple numeric, you would need to change the font size.
    LabVIEW Champion . Do more with less code and in less time .

  • How to pause while document printing and wait for user actions.

    How to pause while document printing and wait for user actions. (for sample: pressed button). Pause after each printed pages.

    Print page by page after considering the user actions!

  • I keep getting error 1053 while trying to upgrsde Itunes for PC

    I keep getting error 1053 while trying to upgrsde Itunes for PC

    I was getting -3231 and kept seeing references online about routers and firewalls and connectivity issues.  I merely turned off my WiFi and went hardwired with ethernet and problem solved.  Give it a try and see if it works for you.

  • Change username and password for PGW2200 ..... ????????....................

    Dear how i can change username and password for PGW2200?
    can give the procedures?
    thanks,

    it is ok ....
    thank you....
    i have now this issue:
    i need to add new E1 to be in the same trunk for previous E1 which is for Abdali. new E1 will not have signal it depeneds at old one timeslot.
    i used this for new E1:
    prov-add:nailedtrnk:name="1033",srcsvc="ss7p-jtc-abdali",dstsvc="naspath1-abdali",srcspan="ffff",dstspan="0",srctimeslot="33",dsttimeslot="33",spansize=31
    for old one this:
    prov-add:nailedtrnk:name="1002",srcsvc="ss7p-jtc-abdali",dstsvc="naspath1-abdali",srcspan="ffff",dstspan="0",srctimeslot="2",dsttimeslot="2",spansize=30
    ============================
    at AS5400 i used to add new E1:
    controller E1 7/2
    framing NO-CRC4
    pri-group timeslots 1-31 nfas_d primary nfas_int 1 nfas_group 0
    Is this true or there are other commands i should use?
    OLD E1 is configured as:
    controller E1 7/0
    framing NO-CRC4
    channel-group 0 timeslots 1
    pri-group timeslots 2-31 nfas_d primary nfas_int 0 nfas_group 0
    description Connection to Abdali
    interface Serial7/0:0
    no ip address
    encapsulation ss7
    channel-id 0
    interface Serial7/0:15
    no ip address
    encapsulation hdlc
    isdn switch-type primary-ni2c
    isdn incoming-voice modem
    isdn map address . plan isdn type network
    isdn rlm-group 0
    no isdn send-status-enquiry
    isdn negotiate-bchan resend-setup
    isdn bchan-number-order ascending
    no cdp enable
    any help please for correct commands i shall use? please see attached file for details.

  • Dynamically changing the height and width of Stage

    Hi,
              I would like to know how can I change the height and width of stage dynamically. I tried it with the following code:
                             Stage.height = 250;
                             Stage.width = 250;
    during the run time. Initially the Stage is at a height and width of 370 and 450 respectively. Also when I tried to trace the height and width of Stage after resizing the stage width and height, its showing the old value of width and height. That means the width and height not chnaging. Anybody have any idea about this.

    Hi Ross,
                I could understand something about the problem after making a research on this topic. We can't change the width and height of stage from actionscript itself, right? I will explain the way I am planning to do. I don't know whether its right or not. Anyway you just go through it. First the player need to be resized, according to the specified height and width. Then in the object tag, there are two fields named height and width. We should change these value according to the specified height and width of video controller, dynamically. Am I right? But I am confused with two properties of Stage such as: align and scaleMode. The code was actually developed my trainer. There, the scaleMode is set to "noScale" and no align property is used. My doubt is how should I set align and scaleMode properties of Stage. Hope you understood what I meant.
    Regards,
          Sreelash.S.

  • Unable to Determine the Change Date and Time for records in infotype 2011

    Hi Everyone,
    We need to know on when the clock-in and clock-out records were interfaced to SAP in infotype 2011.
    The change date/time field in infotype 2011 is blank/not populated. Hence, we're unable to determine on when the clock-in records were updated in infotype 2011.
    It is not possible to get the audit logs for infotype 2011 as it is switched off.
    We found this table TEVEN and just the same thing, the field "change on" is blank.
    Kindly help us on how we can determine the change date and time for records in infotype 2011.

    Hi Prasad,
    Here's the scenario.
    On June 3, it was reported that staff's clock-in record on june 1, 7:00AM is missing in infotype 2011.
    However, when I checked infotype 2011, the record is there.
    So, they are now asking me on when this record was updated in infotype 2011 as they are thinking that there might be some delays in sending of the data to SAP.
    The created on and created at in table TEVEN shows the same, june 1, 7:00AM which seems to be not true as on june 3, it was reported to be missing.
    Can you help further on this?

  • How to determine height and width of a JScrollPane client

    Hi,
    I wish to display a webpage in a JScrollPane and wish to determine the height and width of the HTML content so that I can use the information to generate PDF and control the content on each page. Can anybody let me know how I can do this?
    Thanks in advance
    Prashant Baj

    JEditorPane and getSize()?

  • How to create instant quote tool for website? Customer enters height and width and price is calculated.

    I am trying to create a instant quote tool for my site.. so customer type in there height and width and a price appears but I have no clue where to start.. is there any tutorial or would someone kindly give me some advice on how to do this on dreamweaver. I havent used Dreamweaver in years and I cant even remember anything now
    Kind Regards

    Well this is what I have soo far.. so I want to enter the height /width then if they want to add extras such as fixing options and cut out it will add to the product price ????
    <!doctype html>
    <html>
    <head>
    <div class="summary entry-summary">
            <h1 itemprop="name" class="product_title entry-title">Ral 1000</h1><div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
        <meta itemprop="price" content="160" />
        <meta itemprop="priceCurrency" content="GBP" />
        <link itemprop="availability" href="http://schema.org/InStock" />
    </div><div itemprop="description">
        <script src="https://apis.google.com/js/plusone.js" type="text/javascript">
    </script>
    <script type="text/javascript">gapi.plusone.go();</script>
    <p>6mm, low iron, toughened glass, PAR
    </div>
    <div class="shortcode-google-plusone"><div class="g-plusone"  data-size="standard" data-annotation="none"></div></div><!--/.shortcode-google-plusone-->
    </p>
    </div>
    <form class="cart" method="post" enctype='multipart/form-data'>
            <table id="price_calculator" class="simple_price_calculator">
            <tr>
            <td style="text-align:right;">
              </td>
    <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
    <script>
    $(document).ready(function() {
    $('#width').keyup(function() {
    var height = $('#height').val();
    var width = $('#width').val();
    var price = (height * width / 1000000 * 325).toFixed(2);;
    $('.price').html('Product price: &pound;' + price);
    </script>
    </head>
    <body>
    <p><label for="height">Height (mm)</label>
    <input type="text" name="height" id="height">
    </p>
    <p>
    <label for="width">Width (mm)</label>
    <input type="text" name="width" id="width">
    </p>
    <p>
    </p>
    </body>
    </html>
        </tr>
    </table>
    <div class=" product-addon product-addon-add-fixing-option">
                <h3 class="addon-name">Add Fixing Option </h3>
        <p class="form-row form-row-wide addon-wrap-1738-add-fixing-option">
        <select class="addon addon-select" name="addon-1738-add-fixing-option">
                        <option value="">Select an option...</option>
                        <option data-price="5" value="silicone-adhesive-tube" >Silicone Adhesive Tube (<span class="amount">&pound;0.00</span>)</option>
                        <option data-price="5" value="screws-and-drill-holes" >Screws and Drill Holes (<span class="amount">&pound;6.00</span>)</option>
        </select>
    </p>
        <div class="clear"></div>
    </div><div class=" product-addon product-addon-add-extra-layer-multi-coloured-fine-glitter">
                <h3 class="addon-name">Add Cut Out and Notches </h3>
        <p class="form-row form-row-wide addon-wrap-1738-add-extra-layer-multi-coloured-fine-glitter">
        <select class="addon addon-select" name="addon-1738-add-extra-layer-multi-coloured-fine-glitter">
                        <option value="">Select an option...</option>
                        <option data-price="8" value="1" >1 (<span class="amount">&pound;25.00</span>)</option>
                        <option data-price="15" value="2" >2 (<span class="amount">&pound;50.00</span>)</option>
                        <option data-price="25" value="3" >3 (<span class="amount">&pound;75.00</span>)</option>
                        <option data-price="25" value="4" > (<span class="amount">&pound;100.00</span>)</option>
        </select>
    </p>
    </p><p class="price">Product Price: &pound;</p>
        <div class="clear"></div>
    </div><div id="product-addons-total" data-type="simple" data-price="160"></div>
            <input type="hidden" name="add-to-cart" value="1738" />
            <button type="submit" class="single_add_to_cart_button button alt">Add to cart</button>
                </form>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    </head>
    <body>
    </body>
    </html>

  • How to resize and maintain height and width ratio IR image column

    Hello, I am upgrading from 3.2 to 4.1 reports that include images in report columns. I have had good success with this except for one thing. If the height and width is fixed it distorts the photos, and if I do not have fixed dimensions the image may be too large depending on the original dimensions of the :P1_PHOTO item which is File Browse... BLOB column. I do not want to restrict users ability to upload large image files, or files with different dimensions, but I want them to display as a thumbnail size proportional to the original dimensions in the report, or maybe I need a different approach? Report region template is No Template. I appreciate any suggestions.
    select decode(nvl(dbms_lob.getlength(photo),0),0,null,'<img src="'||apex_util.get_blob_file_src('P1_PHOTO',id)||'" height="75" width="75"/>') photo from table.
    I tried using percent i.e.: width="10%" that does not work.
    I have tried several variations of <style> in page HTML header to change column width, but the image size does not change.
    <style>
    td[headers="PHOTO"] {
    width:75px;
    </style>
    <style>
    #apexir_PHOTO{width: 75px;}
    </style>
    Thanks.

    Try to go with max-width / max-height. However, if you have IE browser, hang on for pain. For some ideas, some links:
    http://wordpress.mfields.org/2011/scaling-images-in-ie8-with-css-max-width/ (ignore object-fit, it is not yet supported on most browser)
    http://stackoverflow.com/questions/3915219/max-width-on-img-tag-not-working-in-ie8
    etc. Be sure to try out your chosen solution on the target browser(s)!
    IE is just nasty :(
    What i have done before is not to have my browser scale my images, especially when the images can be large(r) and you expect quite some traffic. All those extra (kilo)bytes won't help it load faster. I just added an extra column in the table, like photo_thumb, and create a scaled version of the uploaded picture when it is being inserted.
    For example, i have the following process on my apex page, and i'm using wwv_flow_files.
    Have some code:
    IF :P3_FIND_PHOTO IS NOT NULL THEN
       DECLARE
         v_id number;
         v_small_photo blob;
         v_large_photo blob;
         v_mime_type apxt_contacts_img.mime_type%type;
         v_content_type apxt_contacts_img.content_type%type;
       BEGIN
          SELECT blob_content a, blob_content b, mime_type, content_type
          INTO v_small_photo, v_large_photo, v_mime_type, v_content_type
          FROM wwv_flow_files
          WHERE name = :P3_FIND_PHOTO;
          IF lower(v_mime_type) NOT IN ('image/jpg', 'image/jpeg') THEN
             raise_application_error(-20001, 'File for upload is not a jpg!');
          END IF;
          -- Rezise the photo so that it is proportionally 125*125
          -- ordimage is an oracle type able to manipulate all sorts of pictures
          ordimage.process(v_small_photo, 'maxScale=125 125');
          -- If contact is of type personnel, then no need to store
          -- a large photo since it wont be displayed
          IF :P3_CONTACT_TYPE_ID = 2 THEN
            v_large_photo := NULL;
          END IF;
          -- Delete previously uploaded picture
          IF :P3_ID IS NOT NULL THEN
             DELETE FROM apxt_contacts_img
              WHERE contact_id = :P3_ID;
          END IF;
          -- Insert the data into the contacts_img table as a
          -- SELECT from WWV_FLOW_FILES
          INSERT INTO apxt_contacts_img
          (contact_id,
           image_name,
           mime_type,
           content_type,
           filename,
           small_photo,
           large_photo)
          VALUES
          (:P3_ID,
           :P3_LASTNAME,
           v_mime_type,             
           v_content_type,
           :P3_FIND_PHOTO,
           v_small_photo,
           v_large_photo);
          -- Remove the image from the apex wwv_flows_files table
          DELETE FROM wwv_flow_files WHERE name = :P3_FIND_PHOTO;
       END;
    END IF;

Maybe you are looking for

  • VERY CONFUSED and STUCK!!! About to throw computer out of window!

    Hi,      I have been using a template with guidelines (are these paths?) to design within. The shape I am designing within is a curved one, (for an ice cream tub) therefore any text I have used has had to follow the guidelines. (so bending slightly r

  • Problem with new photo on the OS X Yosemite

    Hi, I've just upgraded to the OS X Yosemite software and now find that I can't access the iPhoto library on my hard drive...any ideas? It says that it doesn't have permission to create a photo library in my hard drive. I've repaired the permissions o

  • Customer master error message

    Hi, We recently upgraded ECC 5.0 server from support pack 13 to 19 (SAP_APPL).  After that when we wanted to display/change the master data for customer in XD02, it has started giving the message "Field KNVV-CHSPL does not exist in field status table

  • Enums don't work over RMI-IIOP

    Enums do not deserialize correctly so that MyEnum.ONE.equals(deserializedMyEnum); See for yourself. import java.rmi.*; import java.util.*; import javax.rmi.*; import javax.naming.*; enum MyEnum { ONE, TWO, THREE }; public class EnumIIOPBreakage   pub

  • Downloaded songs

    i recently downloaded a song from the internet and now it will not transfer to my iphone..what's going on?