Basic question, duplicating a circle with javascript

Hello. I'm trying to build something like a bullseye using javascript. I'm new to scripting for Illustrator but I've used javascript before so I thought it would be simple, but maybe I'm missing some basic notions here.
I'm using Illustrator CS6. I created a blank document and drew a circle with a 1pt black stroke and no fill. Selecting that circle, I my script to copy and paste it in front and increase its radius by one centimeter. I attempted a simple duplication first:
if ( app.documents.length > 0 ) {
    var numberOfItems = 3;
    var selectedItem = app.activeDocument.selection;
    for (i=0; i < numberOfItems; i++) {
         newItem = selectedItem.duplicate();
With my circle selected I get an error message saying "Error 24: selectedItem.duplicate() is not a function". What am I doing wrong?
Thank you in advance.

if ( app.documents.length > 0 ) {
    var numberOfItems = 3;
    var selectedItem = app.activeDocument.selection;
    for (i=0; i < numberOfItems; i++) {
        newItem = selectedItem[i].duplicate();
maguskrool wrote:
Thanks. I got an error using this option, though, not sure why but it says the last item (in this case, selectedItem[i] when i = 2) is undefined.
Your script says:
When (min) one document is open --> say numberOfItems = 3        //the counter is 3 --> min three or more items should be selected by yourself
selectedItem --> is the array of all selected items in document
then go for counter = 0 to counter < numberOfItems (means 3-1) -->
counter 0 = loop 1 --> duplicate this (item 1 of 3 selected) item
counter 1 = loop 2 --> duplicate this (item 2 of 3 selected) item   //when only 1 item is selected by yourself --> result is undefined
counter 2 = loop 3 --> duplicate this (item 3 of 3 selected) item   //when only 2 items are selected by yourself --> result is undefined
It's equal, how many items are selected by user - but min you have defined here --> var numberOfItems = 3; 
You need in this example a selection of three items (better: three selected items)

Similar Messages

  • Idiotic Basic Question - making a circle with transparent bg driving me nuts!

    OK, disclaimer - I have been using an old version of elements and just upgraded to Photoshop CS5 Extended.  All I want to do is:
    1)  Create a circle for a logo.
    2)  Add text and drop shadow.
    3)  Make bg transparent.
    Why am I getting the white line around the circle?  (The circle will be the logo.  Right now it is a 240 x 240 gif that is floated on top of the header using CSS).
    Thanks,
    Gary

    In addition to Noel's advice, there is no need to rasterize the shape layer
    to change the color, just double click on the solid fill color to change the color
    of your circle. Also move your shape layer above the white layer and turn off the
    visibility or delete the white background layer before saving as a png-24.
    You might also try Image>Trim to crop the circle. Pick transparent pixels in
    Image>Trim dialog.
    MTSTUNER
    Message was edited by: MTSTUNER

  • Basic Questions on BOBJ inrelation with BI

    Hi,
    I am working in SAP BI 2004s. I have few basic questions on BOBJ.
    1. What is Rapid Mart? Is it an ETL tool? If so is it set to replace existing BI extractors from ECC (R3)?
    2. when data is extracted thru Bussiness Obejcts rapid mart where the data will be stored? BI Info Cubes? or any data ware house tables?.
    3. If stored in BI InfoCubes, should universe to be created for the cubes? if so, each dimesnion will be treated like a table to create joins?
    4. Can I automate the result of WebI downloaded to excel to Excelcius Dashboard with any manual steps involved? in otherwords Xcelcius shows the chart or dashboard out of the WebI query result.
    ( I am trying to see how all these products work. In 2004s I use WAD and call individual queries to generate a dashboard)
    Thanks,
    Alex.

    Hi,
    1. What is Rapid Mart? Is it an ETL tool? If so is it set to replace existing BI extractors from ECC (R3)?
    A Rapid MArt is a pre-designed set of database schemas, universes and reports from BusinessObjects. Available for SAP ERP as well. Details can be found here : http://www.sap.com/solutions/sapbusinessobjects/large/intelligenceplatform/im/data-integration/rapidmarts/index.epx
    2. when data is extracted thru Bussiness Obejcts rapid mart where the data will be stored? BI Info Cubes? or any data ware house tables?.
    When it is a Rapid Mart then it is a relational database but the tool - Data Services - can also load to other targets like BW.
    3. If stored in BI InfoCubes, should universe to be created for the cubes? if so, each dimesnion will be treated like a table to create joins?
    You can create multi dimensional universes and relational universes on top of BW. Depends on your goal really.
    4. Can I automate the result of WebI downloaded to excel to Excelcius Dashboard with any manual steps involved? in otherwords Xcelcius shows the chart or dashboard out of the WebI query result.
    ( I am trying to see how all these products work. In 2004s I use WAD and call individual queries to generate a dashboard)
    Yes - possible.
    perhaps you can provide  a little bit more on what you trying to achieve and then I can point you to more specific information.
    ingo

  • Basic questions from techie thicko with 'new' G4

    I've looked but can't find the answers to these basic questions.
    My new (reconditioned) computer as below came with just the operating systems and something called 'Cloner' plus some Utilities.
    A) What is the best way to switch between OSX and Classic?
    (It defaults to X on start-up and I can get to X from Classic by re-starting pressing 'x'. If that's the right way to do it, what is the approved way of getting into Classic?)
    B) I'm not sure (after reading about it!) what I can do with Cloner and how.
    C) I have AppleWorks on OS9. Can I update this for OSX? Failing this, is there a Software Download that will give me a basic DTP facility until I can afford to buy an advanced programme? I also have Pagemaker 7 in Classic.
    D) I have been transferring stuff to Classic from my iMac DV 9.2.2 with my card reader and this seems to work well. Anything to watch out for?
    There's more but I can't impose on members' kindness too much!
    For future reference, is it possible to post pictures on these boards and if so how please? I have Photoshop and hosting sites.
    Sorry to be a pain but I really am an idiot about techie stuff.
    Thanks for any help.

    I'm not sure what Cloner does. It sounds as if it may clone the hard drive, a bit like Carbon Copy Cloner:
    http://www.bombich.com/software/ccc.html
    I'm wondering whether it was just used to put the operating systems and utilites onto the drive in the first place when they reconditioned the computer. Perhaps they use a 'master' drive and just clone it to the drives in the computers they're reconditioning, rather than installing everything separately and repeatedly.
    I think version 6 of AppleWorks runs under both OS 9 and OS X natively. If you have an earlier version, I'm not sure whether it's a free downloadable upgrade or whether you have to pay for it.
    I'm sure the card reader works fine, although you could network the two computers together with an ethernet cable and create a small network. With two computers you just need a crossover cable to create a crossover network:
    http://docs.info.apple.com/article.html?artnum=106658
    If you're thinking of keeping your iMac, that may be a better long term solution. You could then use the iMac as your OS 9 machine and the PowerMac as your OS X machine if you wanted to.

  • Basic Questions on Getting Started with MDK

    What I discover at this point is that I can't see any sign of the MDK in Eclipse. There is an article that talks about installing the MDK, but what it really talks about is installing the client engine. For the process, you need a live SAP Web Server to talk to-- i.e., a backend.
    I don't see any samples that were downloaded with the MDK. It just consists of a set of plugin jar files for Eclipse. No samples whatsoever.
    I'm not sure where to go from here. A contact at SAP would be helpful to help me figure out what it is I need to look at.
    One thing I have found out: The SAP Mobile Infrastructure (MI), which is what I am looking at, is for developing either thin client applications using JSP or fat client Java programs, both of which rely on a local run-time engine that talks to a real SAP backend. It would be impossible to do any development or even run a pre-built application without having a backend to talk to.
    We do not have SAP installed, so we need some help with connecting to a backend system and getting the MDK properly installed. Thanks.

    Hi Brent,
    First of all, thanks for checking out the MDK.
    If you want to use the MDK, you can install the SAP NetWeaver Developer Studio (NWDS). You can see the MDK in the Help menu item. From there, you will be able to navigate the MDK documentation.
    I strongly suggest you to use NWDS instead of Eclipse. MDK is a set of documentation, tutorials and examples; together with a plug-in for the IDE to develop MI-based mobile application.
    Mobile Infrastructure comprises of a client and server components. The MI Client component runs on the mobile device while the MI Server Component runs on the "middleware" server (ie: the SAP Web Application Server). Starting SAP NetWeaver 2004, the MI 2.5 Server component ships with the SAP WebAS 6.40. You will need a backend server (eg: R/3, ERP2004, etc.) to get the business data as well.
    You can check out the MI online documentation for more information:
    http://help.sap.com/saphelp_nw04/helpdata/en/a7/893a5889e08b41b615688b1a93b559/frameset.htm
    Hope that helps.
    Peter Ng

  • Basic question: will email sync with icloud?

    will my email sync?
    I don't understand what it means when it tell me that when you switch to icloud your mail accounts won't sync.  Please explain?

    Yes it will Linda,
         When .mac/mobile Me gets moved (when you make the choice to do so) to the new iCloud servers, your mail will be as you expect.
         Mobile Me & .Mac used to synch mail 'account info' and/or mail 'rules' but it never synched the actual e-Mail itself. These two settings now are not explicitly backed up to iCloud like they used to be.
         You lose no mail or accounts, but you do not have the ability to re-synch a new Mac or a re-built Mac on the same account on the way that you used to be able to do. However, you probably will never need to because iCloud is now the master computer for mail operations—so to speak. And when you register a new computer or iDevice on iCloud mail will come along with it if you so choose.
    -Alan

  • HT1311 I know this is a basic question, however, how do i change my pass word on itunes to stop my kids from automatically buying tunes from the I store... as my card details are already saved they just log in with their ipods and download via my account

    I know this is a basic question, however, how do i change my pass word on itunes to stop my kids from automatically buying tunes from the I store... as my card details are already saved they just log in with their ipods and download via my account

    http://support.apple.com/kb/HE36
    Regards.

  • Basic questions with respect to ABAP WebDynpro Application

    Hi All,
    I have two basic questions with respect to an ABAP WebDynpro application :
    a) If an ABAP WebDynpro application has been developed, how could it be made available to the end user?
    b) Can an ABAP WebDynpro application be developed in ECC or is it only applicable for version 4.6c?
    Thanks & Regards,
    Sushanth Hulkod

    Sushanth Hulkod wrote:
    > a) If an ABAP WebDynpro application has been developed, how could it be made available to the end user?
    >
    > b) Can an ABAP WebDynpro application be developed in ECC or is it only applicable for version 4.6c?
    a) If an ABAP WebDynpro application has been developed, how could it be made available to the end user?
    Answer - By providing direct link of the WD application created in SE80, creating iView for webdynpro abap application in the portal environment and  NWBC environment
    b) Can an ABAP WebDynpro application be developed in ECC or is it only applicable for version 4.6c?
    Answer - Yes it can be developed in ECC. Webdynpro ABAP is introduced in NW 2004s (SAP NetWeaver 7.0 or ECC 6.0)
    Thanks,
    Chandra

  • Possibly a very basic question but I have set up a spread sheet in Numbers and have viewed help videos but I can't get it to give me sums for the columns I highlight.  Keeps coming up with the figure zero.  I have version 09 2.3(554). Can anyone help

    Possibly a very basic question but I am going nowhere without a solution.  I have set up a spreadsheet in Numbers but it won't give me sums for chosen columns. I  have viewed the run through videos and used the formula but nothing happens apart from giving a figure of zero or a red arrow.  The sum icon in the bottom left hand section of the window does not highlight or show any total as I understand from the video that you can drag whatever total is here onto the relevent position on your spreadsheet.  I have Numbers 09 version 2.3 (554). Can anyone advise. Thanks.

    Hi Sohojools,
    To sum a column, use a formula such as this one in Cell A6
    Type this in a cell below your data:
    =SUM(A2:A4) or whatever range of cells you want to sum. The easy way is to type:
    =SUM(
    and then drag or shift-click to select the range of cells. Close the formula with a final bracket ")".
    The sum icon in the bottom left hand section of the window does not highlight or show any total
    To see the sum (and other simple statistics) in the bottom left, select a range of cells. That tells Numbers which cells you are refering to.
    The videos are good, but the Numbers'09 User guide, and the Formulas and Functions User Guide are better. Download them from the Help Menu in Numbers.
    Regards,
    Ian.

  • This is probably a stupid question, but what does the red circle with a number in it mean on iCal? It looks just like the emails notification. I do not have anything do or up in my cal.

    This is probably a stupid question, but what does the red circle with a number in it mean on iCal? It looks just like the emails notification. I do not have anything do or up in my cal.

    Actually, another person on the "more like this" had the right answer. It meant I had a notification for an invite that I needed to respond to.
    Hope this helps you as much as it helped me.
    D

  • Basic question, how to create rtf template with a given xml file

    Hello guys
    I am new to BI publisher and I am learning how to create rtf templates using given xml fiel definitions by following the bi publisher guide
    The steps I am following is:
    1, create template using template builders, which is downloaded into MS words.
    2, In the empty template, map the xml columns with template field using BI publisher tag
    3, upload the template to BI Publisher as a layout.
    That's all I can understand.
    My question is:
    1,in which above step do I import XML file into template builder (if not bi publisher), how to do so?
    2,After template is created, how to associate this template layout with existing reports in BI Publisher, or is it necessary at all?
    3,In the template content in MS Word template builder, what should I enter other than BI publisher tags for mapping XML field to desired template field
    Or, if my understand of this process is entirely wrong, what's the right process of creating rtf template with a given XML file definition
    Thanks

    If you have a BI Publisher desktop installed, have a look a the demos,.. should answer most of your basic questions.
    (Windows) Start->Programs->Oracle BI Publisher Desktop->Demos
    Invoice Demo - good one for those with E-Business Suite
    Report Demo - Sample using BI Publisher

  • What todo with those who keep on answering basic questions - Your thoughts?

    Hi Experts,
    I have been active in ABAP Development Forum and usually hit the abuse button around 50 times a day.
    And most of the cases is for posting queries which are very basic and can be searched in SCN or in any Search engine.
    Example: The specified item was not found.
    Subject : BAPI
    Question :
    >
    muralireddy manyam wrote:
    > whats the  difference between normal function module and bapi function module?
    Although this is the mistake of the poster, i can see around 5 - 10 replies for such posts in a few seconds. Most of the replies are posted with Copy + paste content from SAP documentation/ other sites, some link farms etc.
    What i feel is this type of replies only encourages other people to post such basic questions again and again.
    So i think a little amendment need to be added to the Forum guidelines prompting members not to post replies/links to basic questions which can be easily searched.
    What you people think of it? Your thoughts are welcome and i hope some moderator would be in a better position to answer this.
    Regards
    Karthik D

    Hi Karthik,
    Your BAPI example took a whack together with all it's answers and the other questions by the same lazy bones fresher.
    There is no real answer to your question, because more usable expert forums and keeping the quality up to standard is a constant thing. Each new batch of freshers brings new challenges with them, and new types of points-gaming, etc. So it is the journey which counts
    At other times some tollerance is also appropriate - for example when the person has language problems and is using a translator.
    But for the lazy bones who don't even have common sense, there is no SDN medication available. No amount of waiving the rules at them helps. The only think which can be done is to delete it on sight and try to catch them as early as possible.
    For this the folks who use the Abuse Reports button are the true heros of the forums, as it is impossible for moderators to be everywhere all the time.
    Cheers and thank again!
    Julius

  • Hello, this might be a basic question, but how do you open QuickTime to record a new webinar? I have a new MacBook Pro with Yosemite and can only get QuickTime to appear in Finder but not actually open to allow me to record something new. Thx.

    Hello, this might be a basic question, but how do you open QuickTime to record a new webinar? I have a new MacBook Pro with Yosemite and can only get QuickTime to appear in Finder but not actually open to allow me to record something new. Thx.

    Hi Winterwilly,
    Welcome to Apple Support Communities. 
    The article linked below answers your question of how to use QuickTime to record something on your MacBook Pro’s screen.
    QuickTime Player 10.x: Record your computer’s screen
    Cheers,
    -Jason

  • I have received an Email with an attachment(IMG.0157.Mov) that loans but then becomes a circle with a question mark. What to do?

    I have received an Email with an attachment(IMG. 0157.Mov)that loads but then becomes a circle with a question mark. What to do?

    Assuming it's from a trusted source it's probably a video format that your system doesn't support.
    If it will load in QuickTime Player, do a Get Info (⌘ i) to see what the specific format is. The .mov is a generic suffix a dozens or more video formats, the Get Info will give you the details.
    hope this helps

  • I upgraded the OS on my iMac to Lion from the App store; and after installation, it restarted and now the operating system won't start up.... it keeps displaying the apple/folder with a question mark and a circle with a line through it! Please help!

    I upgraded the OS on my iMac to Lion from the App store; and after installation, it restarted and now the operating system won't start up.... it keeps displaying the apple/folder with a question mark and a circle with a line through it! Please help!

    Try starting up with your Snow Leopard DVD and see if the disk can be repaired. Once you are at the installer screen go to the Utilities Menu and choose Disk Utility and choose repair disk. You might also want to try Diskwarrior.
    Hope this helps.
    Ben

Maybe you are looking for