How to move and resize a whole layer with different objects and groups

Ok, I am a bit confused here.Things are not working like I thought they would and the documentation has confused me more.
currently in my code I have
var embedLeftSleeve = new File(folderPath+"/LeftSleeve.ai");
var leftSleevePlaced = doc.groupItems.createFromFile(embedLeftSleeve);
                        leftSleevePlaced.top = currentHeight;
                        leftSleevePlaced.left = 0;
I am importing an AI file and trying to put it into its own layer. I want it (the imported ai file) into into it's own layer. And I would like the layer to be setup the exact way it was in the original. But, after the import it seems to group non-grouped items, some of the objects are not showing the same way they did (like a shape with a gradient fill in it).
And finally, I want to scale all of the items in that layer as if I selected the layerer in illustrator and scaled it by hand (but scripting it to a set scale).
Can someone please help me. I am digging deep into the documentations and looking all over online to find what I want with little luck.
John

Any chance of a sample of your art? I had a quick and my test art does NOT break up or look any different.
I've been trying to build myself a set of library functions so my methods may appear a little odd.
This was fine for me…
#target illustrator
var sleveArt = new File ('~/Desktop/Untitled-2.ai');
var artName = sleveArt.name;
var docRef = app.activeDocument;
with (docRef) {
pageOrigin = [0,0];
rulerOrigin = [0,0];
var docHeight = height;
myLayer = layers.add();
myLayer.name = artName;
myGroup = myLayer.groupItems.createFromFile(sleveArt);
myGroup.top = docHeight;
myGroup.left = 0;
resizeObject(myGroup, 140, 140, 100, 'BL');
selection = null;
function resizeObject(obj, sX, sY, clw, tr) {
if (verifyObject(obj)) {
var transAbt = getAnchor(tr);
obj.resize(sX, sY, true, true, true, true, clw, transAbt);
return true;
function verifyObject(obj) {
if (obj.typename == 'CompoundPathItem'||'GraphItem' || 'GroupItem' || 'PathItem' || 'PlacedItem' || 'PluginItem' || 'RasterItem' || 'SymbolItem' || 'TextFrame') return true;
else return false;
function getAnchor(x) {
var thisTrans;
switch(x) {
case 'B' : thisTrans = Transformation.BOTTOM; break;
case 'BL' : thisTrans = Transformation.BOTTOMLEFT; break;
case 'BR' : thisTrans = Transformation.BOTTOMRIGHT; break;
case 'C' : thisTrans = Transformation.CENTER; break;
case 'DO' : thisTrans = Transformation.DOCUMENTORIGIN; break;
case 'L' : thisTrans = Transformation.LEFT; break;
case 'R' : thisTrans = Transformation.RIGHT; break;
case 'T' : thisTrans = Transformation.TOP; break;
case 'TL' : thisTrans = Transformation.TOPLEFT; break;
case 'TR' : thisTrans = Transformation.TOPRIGHT; break;
return thisTrans;

Similar Messages

  • How can I sort a collection of array with different object types in it ?

    Hi all,
    I have a collection of ArrayList; each array contains, at the first position, the same object type.
    I'd like sorting the collection by the name contained in the object at the first position of each array.
    Any suggestion ?
    Cheers.
    Stefano

    so you have a collection of a collection?
    My guess is that:
    You could subclass the arraylist and override it's compareTo method (I think that it implements comparable already but if not, go ahead and implement that interface).
    Or you could wrap your arraylist in another class that implements comparable.
    The key in my mind is correctly coding your compareTo method to look at the name in the first item of the arraylists. This should be doable and not too difficult.
    Correction: after reviewing the ArrayList api, I see that it doesn't implement the Comparable interface. You will have to make any class that either inherits arraylist or contains arraylist implement the comparable interface.
    One last thing: This question would probably have been better off in the java forum and not the Swing forum since it doesn't really involve Swing.
    Good luck!
    Edited by: petes1234 on Nov 19, 2007 6:17 AM

  • How much movies  and music can i download to a 16gb iphone

    how much movies and music can i download to a 16gb iphone 4s

    a movie is maybe about 1gb
    a cd if about 600mb before it's mamde

  • How to export and import from AIX to solaris a whole schema with different

    how to export and import from AIX to solaris a whole schema with different character set
    import done in US7ASCII character set and AL16UTF16 NCHAR character set
    import server uses WE8ISO8859P1 character set (possible charset conversion)
    Import terminated successfully with warnings.

    The conversion between the character sets on the two servers are handled automatically. Export from one server will export the data given the character set defined on that server. Import into another server will import the data given the character set defined on that server, performing a conversion if necessary. This can be a problem when going from single-byte to a multi-byte character set. In your case, the warning is simply for your information, shoule be no real problem given the character sets you're using.
    For more info...check out (pertains to 9i):
    Export
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch01.htm#1006791
    Character Ste Migration
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96529/ch10.htm#1656
    HTH

  • HT1391 How do I send iBooks to another device with different email

    How do I move purchased books to another iPad with different email

    ibooks, like other iTunes purchases/downloads, are tied to your iTunes account. If the other iPad is using your account then you should be able to re-download it directly on that iPad via the Store button at the top left of the bookshelf in the iBooks app and then the Purchased tab, or you can sync them to it via your computer's iTunes.

  • How can I read pdf files from LabVIEW with different versions of Acrobat reader?

    How can I read pdf files from LabVIEW with different versions of Acrobat reader?
    I have made a LabVIEW program where I have possibility to read a PDF document.  When I made this LabVIEW program it was Acrobat Reader 5.0.5 that was installed on the PC. Lather when the Acrobat Reader was upgraded to version 6.0, there was an error when VI tries to launch the LabVIEW program. And Later again when we upgraded to Acrobat Reader 7.0.5 I must again do some changes and rebuild the EXE files again
    It isn't so very big job to do the changes in one single LabVIEW program, but we have built a lot of LabVIEW programs so this take time to due changes every time vi update Acrobat Reader. (We have build EXE files.)
    The job is to right click the ActiveX container and Click "Insert ActiveX Object", then I can brows the computer for the new version of acrobat Reader. After this I must rebuild all the "methods" in the Activex call to make the VI executable again.
    Is there a way to build LabVIEW program so I don't have to do this job every time we update Acrobat Reader?
    This LabVIEW program is written in LabVIEW 6.1, but I se the problem is the same in LabVIEW 8.2.
    Jan Inge Gustavsen
    Attachments:
    Show PDF-file - Adobe Reader 7-0-5 - LV61.vi ‏43 KB
    Read PDF file.jpg ‏201 KB
    Show PDF-file - Adobe Reader 5-0-5 - LV61.vi ‏42 KB

    hi there
    try the vi
    ..vi.lib\platform\browser.llb\Open Acrobat Document.vi
    it uses DDE or the command line to run an external application (e.g. Adobe Acrobat)
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

  • How to find users who are running IE with different credentials ?

    How to find users who are running IE with different credentials ? 
    Is there any tool or a solution in the market will help or a i can use GPO or even Power Shell ?
    thnx & Regards ,,

    Hi Salman,
    Based on your description, we can use Windows Credential Manager to check this. Windows Credential Manager stores credentials, such as user names and passwords  that we use to log on to websites or other computers on a network.
    Regarding Credential Manager, the following article can be referred to for more information.
    Credential Manager
    http://windows.microsoft.com/en-in/windows7/what-is-credential-manager
    Manage passwords in Internet Explorer using Credential Manager
    http://www.thewindowsclub.com/manage-passwords-internet-explorer-10
    Please Note: Since the above website is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    Best regards,
    Frank Shen

  • How to do consolidation using two chart accounts with different currencies

    Hi
    How to do consolidation using two chart accounts with different currencies and do we need to use same fiscal year variant ?
    What would be the impossible factors when we use two company codes with two chart of accounts ...
    Regards
    Kesharika

    Good Afternoon
    You need to use translationa and/or valuation
    translation takes account in foreign currency and translates to group currency
    valuation takes account in currency 1 and restates into currency 2 for a company with currency 2
    so depends on which company you are consolidating for, a company in a foreign currency in that currency or consolidating a compnay in foreign currency to parent company in another currency

  • How do i link itunes between two computers with different Apple ID's

    how do I link itunes between two computers with different Apple ID

    You need to set up two user accounts on the mac.  System Preferences>Users & Groups.  Then each user can set up apple IDs for itunes and icloud any way they want.

  • How to compare two rows from two table with different data

    how to compare two rows from two table with different data
    e.g.
    Table 1
    ID   DESC
    1     aaa
    2     bbb
    3     ccc
    Table 2
    ID   DESC
    1     aaa
    2     xxx
    3     ccc
    Result
    2

    Create
    table tab1(ID
    int ,DE char(10))
    Create
    table tab2(ID
    int ,DE char(10))
    Insert
    into tab1 Values
    (1,'aaa')
    Insert
    into tab1  Values
    (2,'bbb')
    Insert
    into tab1 Values(3,'ccc')
    Insert
    into tab1 Values(4,'dfe')
    Insert
    into tab2 Values
    (1,'aaa')
    Insert
    into tab2  Values
    (2,'xx')
    Insert
    into tab2 Values(3,'ccc')
    Insert
    into tab2 Values(6,'wdr')
    SELECT 
    tab1.ID,tab2.ID
    As T2 from tab1
    FULL
    join tab2 on tab1.ID
    = tab2.ID  
    WHERE
    BINARY_CHECKSUM(tab1.ID,tab1.DE)
    <> BINARY_CHECKSUM(tab2.ID,tab2.DE)
    OR tab1.ID
    IS NULL
    OR 
    tab2.ID IS
    NULL
    ID column considered as a primary Key
    Apart from different record,Above query populate missing record in both tables.
    Result Set
    ID ID 
    2  2
    4 NULL
    NULL 6
    ganeshk

  • HT204364 how do I order multiple card or postcard with different images each one in same order?

    how do I order multiple card or postcard with different images each one in same order?
    I keep paying separate shipping cost for each different photo

    That is not an option - with the exeption of photo prints you can only identical items on one order
    LN

  • How do I send docs to multiple signators with different email addresses on Echo sign ?

    How do I send docs to multiple signators with different email addresses on Echo sign ?

    Thanks man...the problem could be on the signators side.
    Rick Schell...Realtor, ABR
    www.rick-the-realtor.com
    Cell 615-804-3085
    Crye-Leike Realtors
    Office 615-373-3513
    Fax 615-373-5228
    Quoting Echosign-Rob <[email protected]>:
    Echosign-Rob  created 
    the discussion
    "How do I send docs to multiple signators with different email 
    addresses on Echo sign ?"
    To view the discussion, visit: 
    https://forums.adobe.com/message/6395941#6395941
    >

  • How to move Items as a whole, without disturbing keyframes

    I have an entire timeline structure with keyframes that I
    need to center on a new background that is a different size. No
    matter what I do, centering the objects affects their travel in the
    timeline. Is there a way to move the whole project without copying
    them as a new combined movie?

    I have a multiframed movie. On my web page, I had a
    background to this movie in a table. For many other reasons (that
    will later show up in the Dreamweaver forum) I want to have an HTML
    page with only a flash object in it. So, I deleted my background
    from the html page, and imported it into the Flash library. I just
    simply want the flash movie to now contain its own background
    instead of being transparent. When I put the background in as a
    layer, the foreground set of layers are not centered on the
    background anymore as they were on the web page. Any 'select all'
    adjustments affect the keyframes and repositions paths in the
    movement of the items in the movie. Combining all under one movie,
    and then inserting it on a layer with the background works, but
    kills my menu sounds and removes some 'stops' here and there as
    well as complicates the fla. Another option is too click on every
    keyframe and readjust paths, but there should be an easier
    way.

  • How todownload movies and store from YouTube

    How to download movies and store from youtube

    There are some browser plug-ins and apps that you can use on your computer. but on the iPad you cannot.

  • How to save a slice of selected layer or selected object

    I am new to Fireworks CS3. I have a layered PSD and want to
    create slices (or images to be used separately on a web page via
    Dreamweaver) from certain selected layers or certain objects
    showing the selected layer and / or object only. I tried and got a
    slice that contains all visible layers cropped to the size of the
    object I wanted. Can someone point me to a resource that will show
    me some tutes or offer an explanation?
    For example, suppose I have an apple as a background image on
    a bottom layer, with other images on other layers overlapping the
    apple in my psd file. How do I create a slice of just the apple?
    And, suppose I have an apple, an orange and a banana on the
    same layer, but I want to create a slice of each fruit
    individually. How is this best done?
    Thanks.

    WorWicWebmaster wrote:
    > I have dealt with this type of problem for years now. I
    have been asking for a
    > solution and oddly enough, Microsoft has provided the
    solution. The latest
    > release of Expression Design 2 now has slicing support.
    They took it to the
    > next level and allow you to indicate which layers, even
    which elements on
    > layers, you want to be "visible" to the slice. If a
    layer or element is not
    > marked as visible, it will not be exported with that
    slice. It's as if the
    > graphic(s) were unseen by the slice.
    >
    > This is a very elegant solution to an old problem ever
    since slices were first
    > introduced. I sincerely hope Adobe takes notice of how
    competitors are
    > innovating similar tools. I personally prefer Fireworks
    over Expression Design,
    > but I've been using Design lately just for this slicing
    feature.
    >
    Yes let's hope they do
    Jim Babbage - .:Community MX:. & .:Adobe Community
    Expert:.
    http://www.communityMX.com/
    CommunityMX - Free Resources:
    http://www.communitymx.com/free.cfm
    .:Adobe Community Expert for Fireworks:.
    Adobe Community Expert
    http://tinyurl.com/2a7dyp
    .:Author:.
    Lynda.com -
    http://movielibrary.lynda.com/authors/author/?aid=188
    Peachpit Press -
    http://www.peachpit.com/authors/bio.aspx?a=d98ed798-5ef0-45a8-a70d-4b35fa14c9a4
    Layers Magazine -
    http://www.layersmagazine.com/author/jim-babbage

Maybe you are looking for