Is there a way to add duplicated groupitems to the artboard thats active?

var y = -50; //artboard top margin to place art
var x = 43; //artboard left margin to place art
var actIdx = docRef.artboards.getActiveArtboardIndex();
var actAB = docRef.artboards[actIdx];
for (i = 0; i < iCnt; i++) {
     artType = xmlRoot.child(i).child(0).text();
     docRef.artboards.setActiveArtboardIndex (1);
     if(artType == gpRefName) { //tests xmlValue.name against groupItem.name; if match go ahead
        dupArt = gpRef.duplicate(tgLay, ElementPlacement.INSIDE);
        dupArt.top = actAB.artboardRect[1] + y;
        dupArt.left = actAB.artboardRect[0] + x;
        x+=(gpRef.width + 18);
     //check for overflow of artboard X; start new row
     if(dupArt.geometricBounds[0] >= actAB.artboardRect[2] ) { //if left edge of dupArt is overlapping right edge of artboard
        y+= -dupArt.height + -94; //-94 adds some space between the rows
        x = 43;
    //check for overflow of artboard Y; create new artboard and start at top -50 & x 43 of new artboard
     if(dupArt.geometricBounds[1] >= actAB.artboardRect[3] ) { //if top edge of dupArt is overlapping bottom edge of artboard
        newAB(); //function to create artboard and position in relation to previous
        actAB = docRef.artboards[actIdx];
        x+= -dupArt.width + -100;
        y = -50;
Note: any variables you see not declared, are declared, I just didn't include them here to try to keep this as simple as possible.
Basically the script should duplicate an existing groupItem on the existing artboard and lay them out on a new artboard from left to right, top to bottom. If one of the artpieces in a row overlaps the artboard.right then start new row. If one of the artpieces overlaps the artboard.bottom then create new artboard and start again.
If you omit the last if statement, it works sort of (theres still overlap going on). I'm assuming the script is detecting an artpiece overlapping and its saying OK, NEXT sign we'll start a new row, rather than the one thats actually started overlapping.
If you run the script as is, it starts at the first artpiece position and goes -X without creating a new row. As if the 2nd if statement is saying screw the 1st if statement.
I know the issue is with the 2nd if statement, but I can't figure out how to get them to work together as well as get the 2nd if statement to actually do whats its supposed to do. Unless I should put the if statements inside seperate functions and call them in the main loop? I'm not sure. Any help would be greatly appreciated, as always!

Could you merge the second if statement requirement into the first to make sure that it stops?  Something like;
if ((dupArt.geometricBounds[0] >= actAB.artboardRect[2]) && (dupArt.geometricBounds[1] >= actAB.artboardRect[3]))
        y+= -dupArt.height + -94; //-94 adds some space between the rows
        x = 43;
    //check for overflow of artboard Y; create new artboard and start at top -50 & x 43 of new artboard
     if(dupArt.geometricBounds[1] >= actAB.artboardRect[3] ) { //if top edge of dupArt is overlapping bottom edge of artboard
        newAB(); //function to create artboard and position in relation to previous
        actAB = docRef.artboards[actIdx];
        x+= -dupArt.width + -100;
        y = -50;
This would make it check both the side and bottom of each artwork and when it is done it will then run the next if statement.

Similar Messages

  • Is there a way to add two windows in the same window?

    is there a way to add two windows in the same window?

    what do you mean by your first use of the word "window"? do you mean a visible frame? a section of the gui that the user doesnt see?
    or perhaps you mean you want to add multiple tabs to a single window, so that switching between tabs shows different windows?

  • Is there a way to add/delete words from the predictive text ?

    Is there a way to add/delete words from the predictive text options that my iPhone is giving me? I'm using an iPhone 6 Plus with iOS 8.
    There are specific words that are popping up in the area right above the keyboard where it displays 3 word suggestions to choose from. This area seems to suggest words that I have typed before, I'd like to remove these words. Default seems to select the word in the center and when I'm typing fast on occasion it will recommend and select words that I don't need to use.
    Any help would be appreciated.

    999753 wrote:
    I know in 10g delete is added but in 9i i can only work with UPSERT( update, insert)
    is there a way to add delete into 9i MERGE? or somehow encapsulate it?
    Thank youI would suggest upgrading to a supported version of the database. 9i has been unsupported for many many years now.
    And to answer your question... to the best of my knowledge, there is no workaround. It works as it works.

  • Is there a way to add roman numerals to the footer? (eg. page i of n)

    Is there a way to add roman numerals to the footer? (eg. page i of n)

    Hi Emily ,
    You may face challenges doing this task in Acrobat .
    If you have created the PDF from word ,I would recommend doing the page numbering in Word, not Acrobat, since you have more flexibility with that program.
    Or the second option is ,if you know how to play around with java script.Here is the code for the same.
    Yeah, it's possible. Create a unique text field on each page with this code as the custom calculation code:
    event.value = romanize(event.target.page+1);
    Then place this function at the doc-level (I didn't write that one):
    function romanize(num) {
        if (!+num)
            return false;
        var digits = String(+num).split(""),
            key = ["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM",
                   "","X","XX","XXX","XL","L","LX","LXX","LXXX","XC",
                   "","I","II","III","IV","V","VI","VII","VIII","IX"],
            roman = "",
            i = 3;
        while (i--)
            roman = (key[+digits.pop() + (i * 10)] || "") + roman;
        return Array(+digits.join("") + 1).join("M") + roman;
    Regards
    Sukrit Dhingra

  • Importing a lot of video clips from a Sony camera to FCE; during the Log and Transfer process, is there a way to add multiple clips to the browser instead of one at a time?

    Importing a lot of video clips from a Sony camera to FCE; during the Log and Transfer process, is there a way to add multiple clips to the browser instead of one at a time?

    Select one and click cmd-A which selects them all.
    Then click the import button if it hasn't started already.

  • Is there a way to go and look at the purchases that I paid for on my ipad with itunes?

    Is there a way for me to look at the purchases that I paid for on my ipad with itunes?

    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 PC and into iTunes.
    Recovering your iTunes library from your iPod or iOS device
    B-rock

  • Is there a way to print something showing all the purchases that have been made and what the total cost is?

    Is there a way to print something showing all the purchases that have been made and what the total cost is?

    While it is not possible to directly print your iTunes account purchase history within the iTunes Store, you can take a screnshot of your purchase history on your computer, and then print that screenshot.
    The following article explains how to review your purchase history:
    http://support.apple.com/kb/HT2727
    This articles explains how to take a screenshot on Mac OS X:
    http://docs.info.apple.com/article.html?path=Mac/10.7/en/mh26782.html
    and this does on windows:
    http://windows.microsoft.com/en-CA/windows-xp/help/setup/take-a-screen-shot

  • I've lost my photos (crashed hdd, iPhoto library on Time Machine corrupt too).  Is there a way to create a picture from the thumbnail that remains in iPhoto?  The quality is obviously poor, but better than nothing.

    I've lost my photos (crashed hdd, iPhoto library on Time Machine corrupt too).  Is there a way to create a picture from the thumbnail that remains in iPhoto?  The quality is obviously poor, but better than nothing.

    Time machine should have a good copy - how are you determining that it is corrupt
    If you want the thumbnails as photos right click on the iPhoto library and make a copy of the data folder and then import it into a new iPhoto library - it contains your thumbnails
    LN

  • Is there any way to add a password to the guest account?

    We use a computer reservation system for public computers in my library.  I would love to have the functionality of the guest account so the account is wiped after every log out. 
    The problem with our reservation system is, it requires an account with a password for the system to work properly.  So for the past year, I have been running a standard user account with 3rd party software to lock out the ability to permently change anything on the system.  The problem with this is, it retains any changes users make until the system is restarted, not logged out.  So by the end of a 12 hour day the machine can be pretty screwed up if it hasn't been restarted at some point.
    The Guest Account is exactly what I want, but if I can't find a way to add a password to it there is no way for my reservation system to use it.

    You could write a shell script to do that and run it on logout via a logout hook:
    http://seeskill.wordpress.com/2012/02/23/mac-os-x-login-and-logout-scripts-demys tified/
    https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSyste mStartup/Chapters/CustomLogin.html#//apple_ref/doc/uid/10000172i-SW10-BAJCGEGG
    I can't be of much help writing such a script. Apple also cautions against such scripts since due to the fact that they run as root they're a security risk. Apple recommends using launchd, something which I have no experience with, but I found a presentation on the basics here that might help:
    http://www.macos.utah.edu/documentation/operating_systems/launchd.html
    I don't know of any other way to remove user documents and settings automatically on logout.
    Regards.

  • Is there any way to add sub-mailboxes to the Inbox in Mac Mail 4.5?

    So, back when I was using Mail 3.0, I was able to create new mailboxes/folders within the INBOX of a specific account.  When I upgraded my machine, Mail changed to "Locations" with the generic locations "MAILBOXES", and "ON MY MAC", "REMINDERS" as well as locations for any account, say "IMAP" and "EXCHANGE".  Currently, I can add a new mailbox, but my only options are to add to "ON MY MAC" (and any subfolders within), "IMAP", and "EXCHANGE".  The option of adding mailboxes to anything under the "MAILBOX" tab is not an option.
    What I'm wondering is if there is a way to add mailboxes to accounts and have it show up under the MAILBOXES location, rather than under the specific mail account location, as each mail account, ("IMAP", "EXCHANGE") also holds additional folders for Trash, Sent, Drafts, etc.  I have about two to three folders per account that I would like to keep stored on the server, and when Mail is handling multiple accounts, using the "locations" for each account takes up a surprising amount of space.
    I know that there is a way to get sub-mailboxes for each account in the MAILBOXES location (as I currently have several in an IMAP account), but these were all carried over from Mail 3.0 and any additional mailboxes are delegated to the location "IMAP" rather than MAILBOXES/IMAP/sub-mailbox.
    Basically, I'm wondering if I can create mailboxes like this: MAILBOXES/Account/Mailbox rather than ACCOUNT/mailbox
    *I realize I asked the question several times, but hopefully the additional wording helps to solve the issue.

    There is no way to add anything to the face of a photo in iPhoto at all You will need an extenral editror for that kind of work. You can add text and arrows etc with Preview, already on your Mac or with apps like these:
    Seashore (free)
    The Gimp (free)
    Graphic Coverter ($45 approx)
    Acorn ($50 approx)
    Pixelmator ($50 approx)
    Photoshop Elements ($75 approx)
    There are many, many other options. Search on MacUpdate or the App Store.
    You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.

  • Is there a way to add a number to the items in a playlist?

    Is it possible to number the items in a playlist?  For example, I have books in order and I want to add numbers so I know which one to listen to next.

    There is some variation in the way that different models of iPods handle listing of audiobooks - specifically those broken into multiple parts (files).  I have one old Nano (2nd gen) and a current model (7th gen) - the latter (correctly) lists complete audio books in the Audiobooks menu, each book then listed as one or more parts (typically further subdivided into chapters).  The older one just has a list of parts (ordered by Name or, if set, Sort Name).
    The method that I use to get as consistent listings is possible is to set both Sort Album and Sort Name metadata elements as shown in this example:
    Notes:
    This is an anomaly since the actual book title starts with 'A' which iTunes will automatically strip and set the result as the sort name.  Explicitly setting the Sort Name to the full title overrides this.
    This is a three-part audiobook (i.e., three files)
    This is how I handle series - so these three files (one audiobook) are the 3rd volume of the "Sherlock Holmes" series.  Using 01, 02, 03 rather than 1, 2, 3 allows for series that run to more than 10 titles.
    Since the Name values start with "The" iTunes strips this off to automatically create a Sort Name.
    Another example of books in a series, where each audiobook is made up of two or more parts
    This is the standard I use for (almost) all multi-part books - set the Name value to <title> - Part <part no.> ... note that as in example (4) iTunes automatically strips "The" to generate the Sort Name
    This is an exemption to the rule illustrated in example (6) - its a 12 novel sequence, each with an individual title (Name field), published as four audiobooks each split into three parts.  The Sort Album values ensure that the audiobooks themselves are ordered correctly; the Sort Name values put the individual novels in the right order.
    I'll freely admit that this isn't simple, and that it took me several rounds of trial-and-error to finalize a scheme that works for me.  Obviously you could achieve very similar results by prefixing Name and Album values with serial numbers - I prefer not to do this for largely cosmetic reasons - I like titles to be "proper" titles, not numbered items.  Turingtest2 has a script on his site that takes a slightly different approach (though fully automated) - I tried this but found some issues with portability across the two iPods that I routinely use for audiobook listening.

  • Is there a way to add line numbers in the margin?

    Is there a way to automatically add line numbers in the margin of a document?

    Hi Brian,
    If you go with Peter's suggestion, there are some details that since I've got a minute here, I'll mention...
    Set your Line Spacing for the document text to "Exactly" before you begin adjusting your table, otherwise you will have registration problems.
    Your Table will have to be a Floating object. Otherwise you won't be able to slide it into the margin. And, speaking of the margin, stay out of the gray area with the numbers if you want to print them. The gray border around your document is the area that the printer driver says is non-printable.
    In the Table Inspector, set Columns to 1 and Rows to 20 or whatever you prefer for your document. Set the number of Header Rows to 0.
    To apply the numbering, use the Fill feature: Type 1 in the first cell, type 2 in the second cell. Select both cells. Grab the Fill Handle in the lower right corner of the selection and drag it down to add a series of numbers to the rest of the column. (Easier than typing.)
    Decide how you want to justify the numbering. The Text Inspector has both vertical and horizontal justification controls for this. Just select the entire table and make the settings.
    Set the cell height to match the text line spacing. You can get close with the table row height, and maybe closer with a minor line spacing adjustment. Don't expect perfection, but you can get pretty close.
    You probably don't want the cell borders to show, so with the entire table selected, go to the Graphic Inspector and set Stroke to None.
    Lastly, cause the table to appear on every page by doing: Format > Advanced > Move Object to Section Master.
    Regards,
    Jerry

  • Is there a way to add multiple trailers to the same project?

    Is there a way to have more than one trailer in the same project?  I can copy the video from a trailer into another project but cannot copy the soundtrack.

    Probably the Easiest way would be to create each Trailer that you wanted to eventually combine separately. Then export each one using the Share Menu > Export Movie... (save as Large size to the Desktop). Then combine each one of these by importing them back into iMovie and stitching them together by dragging them into a New Project.

  • Is there a way to add custom functions to the Report Generation Toolkit?

    I would like to be able to delete unused sheets from an Excel report without having  to reopen the file (and Excel) to do it using ActiveX. It is probably not possible since the NI_Excel.lvclass is locked but maybe there is some other way to do it.
    Ben64

    P Anand wrote:
    I just tried to explore the Excel report gen toolkit. In that one when you open a Method (Invoke node) of an excel worksheet you have one option called delete after giving the name of the worksheet that you wanted to delete use the method and check it. Even I have never tried these sort of things.
    It not clear exactly what you mean. but as an alternative I found the Excel Get Active X References.vi in the toolkit, I can use this vi with the delete method. Initially the issue I had was that you can't unbundle the Excel report to get acces to the activeX references when you're outside the NI_Excel.lvclass (as in the following picture).
    Ben64

  • HT204385 Is there a way to see a list of the computers that are authorized on my account?

    Is there a way to see a list of all of the computers that are authorized under my iTunes account?

    No, you can only see how many computers are authorised, you can't see what they are.

Maybe you are looking for