Deleting and replacing layers

So I'm trying to create a fairly simple script that will measure the size of art on the artboard for making printing plates. That part I have working. But once I have made one file, I have to delete the measurements layer manually (which is where the script puts them) so that I can make the next one. I need the script to check and see if there is a layer called "measurements" delete it and then create a new one called "measurements" in which to put the dimensions of the (new) artwork. This way I can keep making files and "saving as" with a new name.

here's a sample
var idoc = app.activeDocument;
// try removing the layer, regardless whether it exists or not
try {
    var ilayer = idoc.layers["measurements"]; // if it does not exist, it will error out....
    ilayer.remove();
} catch(e) { } // ....and continue here, doing nothing
// add a new layer
var ilayer = idoc.layers.add();
ilayer.name = "measurements";

Similar Messages

  • HT1719 I have music on my Shuffle and want to transfer it onto iTunes but when I go to Sync it, it warns me that all the music on my Shuffle will be deleted and replaced with what's on my iTunes. I have a new mac-mini and my old computer was an HP.

    Can anyone tell me how to tranfer the music that is on my Shuffle to iTunes? When I go to Sync it, it gives me a warning that all the music on my Shuffle will be deleted and replaced with what is on my iTunes. I recently changed computers from an HP to a Mac-Mini and did not transfer/sync the itunes prior to getting rid of my itunes. So the music I had on itunes does not appear in my library. Help please!

    See this excellent user tip from another forum member turingtest2 outlining the different methods and software available to help you copy content from your iPod back to your new Mac and into iTunes.
    Recovering your iTunes library from your iPod or iOS device
    Then proceed to do the Erase and Sync or restore the device.
    B-rock

  • Delete and replace video in iweb

    I have iWeb 3.0.4 (iWeb '11 I think). I want to delete a YouTube video on my video page and replace with another YouTube video, or simply call up the YT widget and change the URL address to the video I want. I can't seem to delete the old video and when I drag over the widget to the video and type in the new URL it simply overlays my new video on top of the old one so I have 2 videos in that spot. Is there a relatively simple solution to make this replacement of one video with another?

    First click on the existing video and use the Delete key.  Then add the new HTML snippet with the YouTube embed code.
    OT

  • Calendar deleted and replaced by another one

    Hello,
    My brother sent me his schedule but I guess he sent me the whole calendar because when i accepted it. It deleted my own and put his as a replacement.
    Can i get back my old calendar?
    Thanks

    First of all if you are really worried when you connect the phone to your computer go to the device summary page in iTunes and change to manually manage the device so that you are in control of what goes on to it.
    A synch will transfer purchased items from device to computer and they are always available to re-download from 'the cloud'.  Once you have the songs on your computer I do suggest that you burn them to CD or back them on to an external hard drive as sometimes items are withdrawn from iTunes so you can no longer re-download.  Indeed the terms and conditions we are all accepting today with the IOS7 update specifies that it is our responsibility to back items up.
    So as long as the songs you have already purchased are still available on iTunes, you can download them again should they disappear.

  • I can only download 1 photo album from my computer to the ipad, if I download a second one, it deletes and replaces the first one. How can I fix this?

    I can only download one photo album from my PC to the Ipad, if I try  to download a second album, it deletes the first. Why???

    Put all of your albums into one main photos album that you can sync from. You can only select one main folder of photos to sync to the iPad. If you direct iTunes to sync from a different folder the next time that you sync, the first album/folder will be deleted. You have to include all photos with each sync every time that you sync.
    So create one main folder for photos and place all of your sub folders into that main photos folder, then when yo sync with iTunes, you can select that main photos folder as the "Sync Photos From" folder in the iTunes photos tab and you can select each of the subfolders within that main folder to sync as well.
    But you can only select one level of subfolders to sync. You cannot sync a folder within a folder within the main folder - one level of sub folders only.
    Connect the iPad to the computer and launch iTunes.
    Click on the iPad name on the left side under devices.
    Click on the Photos Tab on the right.
    Select the main photos folder in the Sync Photos From drop down menu
    Click on/select all of the albums or sub folders within that main folder that you want to sync.
    Click on Apply in the lower right corner of iTunes

  • Flash Delete and Replacement

    Running Lion on an MB Pro. I have had Adobe Flash 11 installed for some time, now version 11.2.202.235 but not the current version indicated by Adobe. No apparent problems before, and I watched You Tube items regularly. Upon using this computer last night, I was told or learned that the Flash plug-in was blocked. After checking around, I learned that there is a de-install program at Adobe. However, on the Flash window in System Preferences/Advanced, itself, there is a 'Delete All' button. Should I use this onboard button to delete the Flash I now have. Since I want it, should I then go back to Adobe and download and install the latest version of Flash (which will not otherwise update from the Adobe site, and even though the Flash plug-in is set to update automatically)? Opinions appreciated.

    I am now hearing from a local Mac retail outlet that they have had others calls recently about this difficulty with Adobe Flash being 'blocked', and this 'problem' may be located in Safari (and Apple may be working on it).

  • I cant change my apple ID because my linked e mail address is corporate and is not longer active, how can I delete and replace for mew one

    Does anyone knows how can delete the current I cloud ID form my I phone 5, because the linked e mail is not longer active, because it was a corporate account and i am not working with that company.

    Go to Settings>iCloud, turn off Find My iPhone and provide the password when prompted.  Then change the primary email address associated with the ID as explained here: Change your Apple ID.  After making the change, save any photo stream photos that you want to keep to your camera roll (unless already there) by opening your my photo stream album, tapping Select, tapping the photos, tap the share icon (box with upward facing arrow), then tapping Save to Camera Roll.  Then go to Settings>iCloud, tap Delete Account, choose Delete from My iPhone when prompted (your data will still be in iCloud), then sign back in with the updated ID.

  • Can I get apps back on boyfriends phone after iTunes deleted and replaced with mine after syncing and upgrading to iOS 5?

    Hi,
    PLEASE HELP!!  Last night my boyfriend asked me to sync his phone as he had purchased a new app and it was required to connect to iTunes to finish installing, so we did this, it took forever!!  It also prompted us to upgrade to iOS5, which we did, the sync finished and he unplugged his phone and all of the contacts and apps from my iPhone have moved onto his phone and his apps have disappeared?  Is there anyway at all to rectify this at all?  I know that w had to restore the phone after upgrading to iOS5 but I am sure that I hit restore from partners phone and not from mine. 

    iPhones can only be sync'd to ONE computer.
    And as it was not running iOS5, it had to have been sync to a computer before he could use it.
    So unless it was always backup up to your computer, it is all gone.
    You can redownload apps you bought.
    Sign into his account on the iphone, and go to appstore.
    Go to Updates page,
    you can click on purchased and see what you already bought, and can redownload.
    In future you should only sync your iphone to one computer.
    In iOS5 you can backup online to icloud.
    But sadly the data that was on his phone may be gone now that you updated on your computer.
    Out of interest, I have never had an app that needs to sync to a computer before it downloads or runs.
    What app was it?

  • HT5925 I have an iCloud email on my iPhone that is now old as hacked and unused. I can't access anything as it asks for that account info and I don't remember the password etc. How do I delete it and replace it with my new iPad email? ! Help..

    I have an iCloud email and Yahoo email on my iPhone that is now old as hacked and unused. I can't access anything as it asks for that account info and I don't remember the password etc. How do I delete and replace it with my new iPad email? ! Help..

    Welcome to the Apple community.
    If you are unable to remember your password, security questions, don’t have access to your rescue address or are unable to reset your password for whatever reason, your only option is to contact AppleCare(or Apple ID Support), upon speaking to an operator you should explain that your problem is related to your Apple ID, this way you will not be charged for assistance, even if you don’t have an AppleCare plan.

  • HT4913 It says that when I turn on I tunes match that it will erase the music library on my iOS devise and replaced by what is in the cloud. But I have imported a lot of cd's into my iOS devise and don't want to loose those songs and I don't want them del

    I Had to reinstall windows on my computer. I made sure all my songs etc were on my iPods/iPad. Now when I plug the iPod in it says (in iTunes Match) that my music library will be deleted and replaced by what is in the cloud. However I don't want those songs erased. I want them to go up to the I tunes match cloud.
    so that I can down load them again.
    also how do I get I tunes match to remember my playlists? It only has album etc.
    thank you so very much. I appreciate any help.

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • Limitations when pasting into the replace field when search and replacing?

    Hi,
    I seem to be unable to paste ALL of the code from my pasteboard when  searching and replacing, is there a way to increase the characters?
    Thank you.

    Replacing 500 lines of code is not possible with Find and Replace. The underlying functionality relies on JavaScript. Cramming 500 lines of code into a JavaScript replace command is likely to give Dreamweaver the screaming heebie-jeebies.
    What I suggest you do is to use the Find and Replace dialog box to find what you want to delete, and replace it with something immediately recognizable, such as:
                    PASTE HERE
    You can insert new lines in the Replace field by holding down the Shift key and pressing Enter/Return.
    Then locate the placeholder, and paste in your 500 lines of code.

  • I not so recently changed my email adress I associated with my Apple ID and my iCloud ID. My old email still shows up for iCloud, and won't let me change it to my new email. When I try to delete it and replace it with the proper email, it wants my passwor

    I not so recently changed my email adress I associated with my Apple ID and my iCloud ID. My old email still shows up for iCloud, and won't let me change it to my new email. When I try to delete it and replace it with the proper email, it wants my password, which it won't accept because it's an invalid username.

    I had this same issue and got it resolved very simply when I contacted Apple SUpport
    Go to https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/ and sign into your infomation
    > Go to Manage apple id and primary email address
    > Change it to the old apple id that your device is asking for
    > Save changes
    > Go to Settings > iCloud and sign out of the infomation
    > Go back to https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/
    > Change it back to the correct apple id
    > Go to the email address adn reverify the apple id
    > Sign back into iCloud on your device
    > Smile
    Article to back up my statement http://support.apple.com/kb/TS5223

  • Is there a way to delete the Apple ID on one device (IPhone 5) and replace the ID on that device with an existing ID used on three other devices?

    Is there a way to delete the Apple ID used on one device (IPhone5) and replace it with another ID that is being used on three other devices?

    If you have turned on Settings > iCloud > Find My you will have to start by turning that off - requires entering the Apple ID password.  Then remove the Apple ID from all places it is used, i.e., Messages, FaceTime, and so on.  Go to the App Store and then Sign Out.  Now you can enter the desired Apple ID and password in all of those places.

  • How can I delete an Apple ID from one device and replace it with a different ID on that same device?

    How can I delete an Apple ID from one device and replace it with a different ID on that same device?

    Tthe brute force method: start with Settings > iCloud and turn off Find My (you will need the password), then change the iCloud ID, then go to the apps such as Messages, FaceTime, etc, and delete the Apple ID and enter the new one.

  • A family member has given me her iPhone. How do I delete her Apple ID and replace it with my own

    A family member has given me her iPhone. How do I delete her Apple ID and replace it with my own ?

    Any Apps that have been downloaded with her Apple ID will remain Tied to that ID...
    You should consider doing a Restore as New and start over with your ID...
    Connect the Device to the iTunes library on your Computer, click on the Device tab that appears in iTunes and click Restore.
    http://support.apple.com/kb/HT1414

Maybe you are looking for

  • How do I keep a document that was created on another computer? I have the link.

    How do I keep a document that was created on another computer. I have the link. https://adobeformscentral.com/?f=Mv9KGJZhLFi47Q-H63fajA

  • Access to libraries denied

    My aperture 3 slowed to a crawl, so in order to speed it up I removed the com.apple.aperture.plist file, along with the library/caches files, restarted it all and now I get an error message when I try to select different libraries, effectively denyin

  • Synchronizing pdf in iBooks

    Hey! When I want to sync my iPad and add pdf files to it (pdfs saved to music - iTunes - iTunes Media - Books) I either have to sync all and I get everything double (old AND new versions) or I have to choose from the list below. The problem is old an

  • Install SCCM on non-domain-membered server!

    Dear friends in my SCCM topology ,on perimeter side , i have server which i want install Primary server to receive updates from internet and give to other side primary server (like WSUS upstream/downstream scenario),but in perimeter i don't have any

  • Packing directory output to a list

    I am new to this, I have tons of directories that I am working on. I want to output the files in each directory to a comma delimited list with each list named after  the directory containing the files.  So far I have been able to write a code that gr