Move/Duplicate/Copy

All,
Ok, so essentially I'm trying to write a script so that I can batch process a whole bunch of .SVG files.
The .SVG files come from a variety of sources... some open very cleanly with nice layer structure, etc... others open with completely wacked clipping masks grouped dozens of times, etc.... So, I need to try and "normalize" the .SVG with a batch process.
Basically the "normalizing" process I'm trying to use involves:
1. "Flattening" the layer structure by ungrouping any nested layers.
1b. Moving all art objects into a single GroupItem.
2. Move/Duplicate/Copy the GroupItem to a new Document with a predefined Artboard size.
3. Re-sizing and positioning the GroupItem on the new Artboard based on some criteria.
Anyway, I'm kind of mystified as to the best way to accomplish this, so I'm trying all kinds of things...
I thought the simplest way to get all the artwork to the new Document would be to use the move() or duplicate() methods.
However, I keep getting 'MRAP' errors for this line:
item.move(newDoc.activeLayer, ElementPlacement.INSIDE);
In the CS5 JavaScript Reference, the object parameter is referred to as a "relativeObject".
Does this mean that you can only move() or duplicate() an item within the SAME document?
Is the app.copy() and app.paste() methods the only way to move art from one Document to another?
Thanks!

Well, I think I found the cause of the 'MRAP' errors... I had my looping logic screwed up, so I essentially was trying to either:
1. Move something that didn't exist.
2. Move something that does exist into something that doesn't exist.
3. Move something that does exist into itself.
Also, fixing that allowed me to use the move() method to move art items (or a GroupItem) from one document to another.
I didn't test it, but I imagine duplicate() would work as well. Both these seem to me to be more desireable than the app.copy() method.
Also, a few notes to anyone trying to do something similar for prosterity sake:
- Moving artwork within a document will reset the PageItem indexes, e.g. doc.pageItems[index]
- If you remove all the artwork from a GroupItem, the GroupItem will remain in doc.pageItems unless you call app.redraw()
- If you're trying to "flatten" some random amount of artwork, CompoundPathItems (as well as GroupItems) and their respective PathItems actually take up separate indexes of the doc.pageItems array. For example:
doc.pageItems[5] // myCompoundPathItem
doc.pageItems[6] // PathItem contained in myCompoundPathItem // Also: doc.pageItems[5].pathItems[0]
doc.pageItems[7] // another PathItem contained in myCompoundPathItem // Also: doc.pageItems[5].pathItems[1]
doc.pageItems[8] // a PathItem NOT contained in myCompoundPathItem
So, generally you want to avoid moving a PathItem that has a CompoundPathItem as a parent, because it will destroy the shape and screw with your indexes to no end.

Similar Messages

  • MW64,  cs6 bridge when I move or copy files the  context menu does not retain  recent folder destinations after I close the program

    W64,  cs6 bridge when I move or copy files the  context menu does not retain  recent folder destinations after I close the program. The context options that show are the ones from original install. The workspace I set up is also gone. I have every explorer box and cleaner checked to save recent. Had to disable nivedia desktop software because of weird display conflict. Have Dell pro support and they cannot fix. Any ideas to help me with this would be appreciated.

    Self-solved!  I work in column view in Finder so get there in a Finder window with folders and files appearing.
    There really is no problem, just select an ITEM in the COLUMN before right-clicking!
    The "old" context menu will appear. If you click in the white space in that column (or anywhere in a Finder window) and then place the cursor over a folder or file WITHOUT selecting it and right-click you will bring up the secondary context menu - Open, Copy, Duplicate, View Options and a greyed out Labels option. No "Move to Trash".

  • I need the duplicate copy of my apple product but the store is under renovation. Is there any possible ways to get a duplicate copy of my apple product?

    I want a duplicate copy of my macbook pro as i have to show it to the service center to get my repair done within the warranty period. But the store from where i purchased my laptop is closed as it is under renovation. What do i do to get a duplicate copy of my product purchase bill. Please advise

    Since you are a year away from being eligible to get a discounted phone on your current Verizon contract, your most cost effective solution is to buy or borrow a used (Verizon) phone from a friend, swappa, ebay or other source.  Use that until your contract is up and then decide if you are going to stay with Verizon or move to someone else.
    Changing providers now will result in $200+ in early termination fees, plus the cost of a new phone for your new provider.
    What you need is not necessarily a way to get the early upgrade discount, but a working phone for your current account - look to friends, swappa, ebay, and other sources to get a good, used, working phone to finish out your contract.

  • How to stop duplicate copy from printing

    Dear All,
                  I have a typical scenario where the duplicate copy is getting printed before some cash movements.I have to stop the form from printing and the driver program is standard 1.can the control set in a smartform not to print if the cash movements are not done???
    i tired using leave program but it stops the total transaction.
    I only want to stop the printing of the smartform.
    Reward points for helpful answers.
    cheers,
    Deepthee.

    Hi Deepthee,
    This post is covering a similar question how to exit outof a smartform?  While it has not been closed yet there may be some suggestions in it you could use.
    Regards,
    Nick

  • How do I move or copy a page from one pages doc to another?

    I used to frequently move or copy a page from one multiple-page Pages document to another just but dragging and dropping the thumbnail.  Since I upgraded I can't do this anymore.  How can I do it now?

    Rhosh18 wrote:
    I used to frequently move or copy a page from one multiple-page Pages document to another just but dragging and dropping the thumbnail.  Since I upgraded I can't do this anymore.  How can I do it now?
    It never worked that way in Pages '09. You have to copy and paste the Thumbnails.
    That no longer works in Pages 5. Sounds like you are not copying and pasting content because that certainly works. Read what VikingOS wrote and do precisely what he said.
    Peter

  • Can no longer move or copy files between drives (not a newbie issue!)

    Copying and moving files between internal and external devices, and external to external devices is no longer working.
    *For the first time in my life, I get a "Circle with a Bar through it" when attempting to move or copy files.*
    This doesn't happen between the two internal drives at all (though I'm worried it might start). It happens between two HFS+J devices as well as HFS+J and FAT32 devices. I can delete files, create folders, and in some instances where things are acting funny, copy to, but not from the device. A noticed side effect that is now happening is that I can no longer move drive icons (CDs, DVDs, HDs) to their upper-right hand corner position on the desktop, if they didn't start there. They don't drop there, just staying where they originally sat (under a list of desktop shortcuts and files). It does not matter if the drives are USB or Firewire, and this never happened previous to about a month ago.
    I have done all the basic stuff -- verify/repair drives, reboot multiple times, mount & dismount, change connection ports, backed up-reformatted-and restored the smallest drive, fixed preferences (not at all relevant), Disk Warrior repair the devices, set all permissions to R/W, check all device related infos, researched on-line for a week... Nothing. I have even taken the devices to PCs, where they work perfectly, and as expected.
    This issue is apparently either a corruption, or a bug induced by Software Update, in the part of the system that handles files and file structures, or possibly the _USB and Firewire_ interfaces.
    I just need to know where all those relevant parts are in the system folders, so I can attempt to restore them from a backup previous to the last "Software Update," (to be sure. And to bring this one step closer to being solved).
    A system restore really is not an option, as that would require nearly two weeks of re-tweaking everything from the system to every piece of software included (updating the system about 10 times via software update, reinstalling 90% of the actual software packages... and then updating those multiple times, looking-up all the serials that get killed, etc.)
    I have to correct this fast, as we need to move the files from the work drives to the archive drives before we run out of room. So any help would be very appreciated... even if you only know where a few of the system components are located (it just might be one of those, causing the issue).
    ---TIA

    {The last link in this post is most relevant, except for your recent finding.}
    The reference was to the User permissions, per each; as when these
    become corrupted, the simple 'repair disk permissions' and other
    basic duties do not find an error with them. That is because there is
    nothing really wrong with them from that standpoint.
    Another odd error can happen if one is resizing partitions in an Intel
    based Mac, and also if one has or had a BootCamp partition and
    wanted to reclaim space. But not always. Thankfully, the only time
    I tried Windows on a Mac, the media install disc was corrupted so
    it just didn't happen. That was Virtual PC and Windows on PPC.
    Tiger brought with it the ability to non-destructively resize partitions.
    However, it was not thought to be successful in non-Intel based Macs.
    The discussion on that matter came up a few years ago, so someone
    has undoubtably tried that in a PPC and reported findings online.
    When file sharing between user-account created content runs amok,
    then the system(s) will not allow the content to be moved or shared.
    So, if any shared user-account created content (including drives
    initialized or handled without permissions ignored, clones wrong,
    etc) are not the problem, then how does one explain these wrong
    ful action circles-with-lines, or action disallowed warning symbols?
    There must be a simpler answer. Do you have cats which have
    access to your computers in the off-hours? They do keyboard.
    Some have been thought to have technical skills outside of the
    usual coy and cute play-acting people think they are limited to.
    I'm sticking to the cats theory for now; the time is 3:21AM here
    and I only am up to get a drink and look outside at +5°F. calm.
    Mac OS X 10.4 Help: I can't move or copy a file or folder
    http://docs.info.apple.com/article.html?path=Mac/10.4/en/mh194.html
    • _Rearranging Files (and renaming them)_ InformIT: Mac OS X unleashed
    http://www.informit.com/library/content.aspx?b=MacOS_XUnleashed&seqNum=122
    It is good to have a backup for the backup; plus a backup Mac.
    Good luck & happy computing!
    { edited: was distracted }

  • How do I "move" (not copy) keynotes from my MacBook Pro to my iMac via sharing?

    How do I "move" (not copy) keynotes from my MacBook Pro to my iMac via sharing?

    Whenever you transfer something from one drive or volume to another, it is copied and the original remains where it was no matter the method you use. It is so by design: just in case you were to delete it on the one drive, you still have it on the other. However, if you no longer want the original, simply delete it and empty the trash.

  • How do I reorganize my photos on iPad 2?  I need to move (not copy) photos from one album to another.  When I use the copy function to another album, and then try to delete an image from the original album, the system wants to delete the photos from all a

    How do I reorganize my photos on iPad 2?  I need to move (not copy) photos from one album to another.  When I use the copy function to another album, and then try to delete an image from the original album, the system wants to delete the photos from all albums.  Please help.

    You can't do it directly on the iPad - the new album functionality basically only allows you to copy photos into those new albums, you can't move them. The way that I think of it as working is that you are just creating pointers to the photos in those new albums, so if you then delete the original photo on the iPad you therefore automatically delete all the pointers to it.
    If you want to re-organise your albums then you will need to do it on your computer and then sync those albums over to the iPad

  • What's the easiest way to move or copy an effect from a layer or object to another layer or object?

    If I drag an effect from the target circle of one object to anther in the layer's panel it replaces the effect along with all appearance. But I want just to add the effect. For example, a layer has a drop shadow and a path, round corners. I want to move the drop shadow from the layer  to the path so that the path now has the round corners and the drop shadow. 
    To do this I have to open the shadow effect of the layer wright down its parameters, then create a shadow effect for the path with the same parameters which is a lot of work. Any easier way?

    Thanks Monika,
    May be I'm not understanding you or may be you misunderstood me.
    This is an example:
    Create a document and a path (for example a box) and apply Effects > Stylize > Round Corners
    In the layers panel, click the target circle of the layer and apply Effects > Stylize > Drop Shadow.
    Now I want to move or copy the drop shadow from the layer and add it to the path without removing the Round Corners effects already applied to the path.
    The result for the path should be Drop Shadow effect added to it and the Round Corners effect remains. 
    The result for the layer should be no effect remains for it in case of moving the effect or the Drop Shadow effect remains in case of copying it (holding Alt key while dragging from its target circle).

  • I've already downloaded and installed the LION. Is it possible to re-download it just to make a USB duplicate copy?

    I've already downloaded and installed the LION. Is it possible to re-download it just to make a USB duplicate copy? If yes, please advise instruction.
    Thanks a much!

    Yes. Open the Mac App Store and click the Purchases icon in the toolbar while holding down the Option key. The "installed" button will change to "install" and you'll be able to download the installer again.

  • Pages makes duplicate copy of my document every time I hit save

    Hi,
    I searched but didn't see this exact problem mentioned anywhere so here goes...
    I'm using Pages 2.0.2 and everytime I hit save on a document I get a duplicate copy with "Backup of" affixed to the front of the file name also saved in the documents folder. The contents of both files are identical and include all the work/changes I've made up until I click save. Both versions of the file are being saved with the standard ".pages" extension.
    This is happening on all of my files and it's driving me crazy.
    I keep reading that Pages does not have an autosave/backup feature and I certainly can't find one in the preferences but mine seems to be backing up anyway.
    Any ideas?

    Hi
    Don't know if this has anything to do with it, sorry if it doesn't, but when you first did File>Save As did you tick the box "Save A Copy in iWork 5 format"?
    Steve
    Just found this in Pages Help:
    Quote: Backing up the previous version of a document when you save it
    Each time you save a document, you can have Pages also save a copy of the document that does not contain your most recent changes.
    To back up the previous version of a document when you save it:
    Choose Pages > Preferences.
    In the General pane, select "Back up previous version when saving."
    Pages saves the previous version in the same folder as the latest version with "Backup of" added in front the document's name. If you make more changes to the document and save it again, Pages replaces the old backup file with the new backup file.

  • GL assignment to the new movement type copied from101(GR of purchase order)

    Dear friends,
    user need another movement type copied from 101 due to diffierent GL assignment needed for the new movement type.
    while below is the only combination for PRD(cost (price) diffierences) is OBYC. and the first row is the current GL assignment for 101.
    My question is :  How do I  assign diffierent GL  for the newly copied movement type ,say Z01.
    General modification       Debit          Credit
                                         530000       530000
    PRA                              530050       530050
    PRF                               530000       530000
    Thanks in advance,
    Linda

    Hi,
    Go to t code OMJJ and locate your movement type Z01. Then go to  Account Grouping on the left pane  and create a new account modifier there. Then give the same account modifier in OBYC settings and assign the GL account against it. 
    Thanks,
    Atal

  • Move or copy iPhoto '11 slideshow from one Mac to another

    How do I move or copy a slideshow created on my iMac to my Macbook Pro

    Export it as a QuickTime movie.
    If you want to move it in an Editable format then you'll need to copy the Library that contains it over to the other machine.
    Regards
    TD

  • How can I move/copy scanned photos that were sent to my gmail account? I have not been able to move or copy to iPhoto.

    How can I move/copy scanned photos that were sent to my gmail account? I have not been able to move or copy to iPhoto.

    Hello SusieMacBook,
    Welcome to the Apple Support Communities! 
    You can definitely get these photos into iPhoto if they are the correct file type (JPEG, GIF, TIFF, and PNG).  The way you import the photo attachments depends on where you check your e-mail.  The following article is for iPhoto 11 (but should work for previous versions as well).  It outlines how to import photos from Mac Mail, other e-mail applications, and web browsers, so just look at the section that applies to you. 
    iPhoto '11: Import a photo sent in email
    http://support.apple.com/kb/PH2354
    I hope this helps! 
    Best,
    Sheila M.

  • The feature move or copy is not working in my software. I am unable to move people

    The move feature on Elements 11 will not highlight for me to use this feature to move or copy.  I have tried to move or copy people from to another picture.

    Is your movetool selected: (Refer the below screen shot)
    if yes, try to reset the tool.
    Click on the drop down list on the right bottom of task bar in photoshop elements (refer the below screenshot)
    Expand the drop down and select the option 'reset tool' (refer the below screenshot)
    try to use the move tool again.
    -Harshit yadav

Maybe you are looking for