How to duplicate the artboard and move it over the original?

Basically, I have a document open and want to duplicate its work plan and then move it to a new location (the X axis, the original 50pixels). Doesn't seem too hard, but I can't understand it. This is for CS5.

var app.activeDocument = docRef;

var abSrc = docRef.artboards [0];

var abSrcX = abSrc.artboardRect [0];

var abSrcY = abSrc.artboardRect [1];

var abSrcW = abSrc.artboardRect [2];

var abSrcH = abSrc.artboardRect [3];

abSrcX = abSrcX + 1221;

var abSrcRect = [abSrcY, abSrcW, abSrcX, abSrcH];

dupAB var = docRef.artboards.add (abSrcRect);

The above works a bit. Original work plan is 17 "x 11" (1224px x 792px) and when I put abSrcX to the foregoing 1221, extendscript throws an error PARM. During one of my sessions of trials and errors, I decided to see what was the document geometricBounds:

$.writeln (docRef.geometricBounds); = 45-12, 1221.154296875,-780

So now, I see a bit where I can't go more than 1221, but why can't I?

I moved the artboard for everything at the top left of the document and I got the geometricBounds again and they were - 6754.5,7038.5,-6463.5, 6736.5, but still can not abSrcX anything about 1221.

the error is "error Illustrator: 1246458189 ("PARM").

I tried to understand this is what courses I can think, but nothings working. Any input or help would be GREATLY appreciated!

EDIT:

So I tried this for the hell of it:

var abSrcX = 0;

var abSrcY = 1224;

var abSrcW = 1224;

var abSrcH = 792; (for some reason any 792 translates into 6 "inside the Illustrator, so I put this 432 to make 11")

var abSrcRect = [abSrcY, abSrcW, abSrcX, abSrcH];

dupAB var = docRef.artboards.add (abSrcRect);

and it adds a new work plan and move to X, Y, such that designated. Not exactly what I want, but narrowing down the issue.

I'm trying

var abSrcX = 1224;

var abSrcY = 0;

var abSrcW = 1224;

var abSrcH = 792;

var abSrcRect = [abSrcY, abSrcW, abSrcX, abSrcH];

dupAB var = docRef.artboards.add (abSrcRect);

and he throws that error PARM still once, then now there is really no sense!

Edit2: I changed abSrcY to 10000 and now the height of the artboard is really long, which is insane even more... I don't have the (x, y, width, height) artboardRect down wrong?

Edit3: If after one more google search, I found out what the problem is. artboardRect is HIGH, LOW, LEFT, RIGHT; and when I do:

var abSrcX = 1368;

var abSrcY = 0;

var abSrcW = 2592;

var abSrcH = - 792;

var abSrcRect = [abSrcY, abSrcW, abSrcX, abSrcH];

top down right and left;

dupAB var = docRef.artboards.add (abSrcRect);

This works. BUT I have no idea what the numbers are in relationship with. The center of the artboard? The document Centre? And if I run it again and change... oh dear.

I think that I just thought of it.

abSrcX is on the LEFT;

abSrcY is HIGH;

abSrcW is RIGHT;

abSrcH is DOWN;

Considering that if I add (1224 + 144) to abSrcX and abSrxW, it creates another work plan 2 "away from the previous 17" x 11 ". If I want to run again, I just have to add (1224 + 144) abSrcX and abSrxW again. Now to find a way to do it dynamically on the fly.

I still like to hear comments on the question of whether this is good or bad, and how I can improve!

@clrx01,.

Why do you work with width and height work plan?

IMHO you need what only once.

Try something like this:

// ArtboardCopy.jsx
// http://forums.adobe.com/thread/1320239?tstart=0
//        How to duplicate artboard and move it relative to original?
// regards pixxxelschubser

var docRef = app.activeDocument;
//var abSrc = docRef.artboards[0];
var abIdx = docRef.artboards.getActiveArtboardIndex ();
var abSrc = docRef.artboards[abIdx];

var moveX = 50;

var abSrc_L = abSrc.artboardRect[0];
var abSrc_T = abSrc.artboardRect[1];
var abSrc_R = abSrc.artboardRect[2];
var abSrc_B = abSrc.artboardRect[3];

var next_ab_L = abSrc_R + moveX;
var next_ab_T = abSrc_T;
var next_ab_R = next_ab_L + (abSrc_R - abSrc_L) ;
var next_ab_B = abSrc_B;

//top left right bottom;

var next_ab = docRef.artboards.add([next_ab_L, next_ab_T, next_ab_R, next_ab_B]);

Have fun

Tags: Illustrator

Similar Questions

  • How to store the original and to remove some duplicate songs in iTunes on a PC Win7, which took place after iTunes to scan for music during a re - install?

    How to store the original and to remove some duplicate songs in iTunes on a PC Win7, which took place after iTunes to scan for music during a re - install?

    I recently had to format my hard drive and reinstall iTunes 12.3.2.35 on my Win7 PC. As part of the re - install iTunes, I clicked on the button scan for music.  This has created duplicates several of my songs.  I deleted then the duplicate songs from iTunes, but when I went to play a few songs a pop-up said "the song would not be because the original could not be found.  You want to locate? "When I tried to locate the song it is not found, but when I pulled the songs out of the trash they could be found.

    How can I keep the original and remove any duplicate songs in iTunes on PC Win7 which took place after iTunes to scan for music during a re - install?

    iTunes can create duplicates if the same content is added several times from outside the media folder when it is about to make copies of everything that is added to the library, or is added from an external drive that hosts the press kit that was disconnected during the launch of iTunes.

    Official notice of Apple on the duplicates is here: find and remove duplicates in your iTunes library. This is a manual process and article fails to explain some of the potential pitfalls such as the lost coast and membership of playlist, or sometimes the same file can be represented by multiple entries in the library as well as a removal and recycling the file will break all the others.

    Use MAJ > display > show items to reproduce exactly to display the duplicates because it is normally a selection more useful. You must manually select all but one of each group to remove. Sort the list by Date added can make easier select appropriate tracks, but it works better when executed immediately after the dupes were created.  If you have several entries in iTunes connected to a same file on the disk hard then don't not send to trash.

    Use my DeDuper script (Windows only) If you are not sure, do not want to do it by hand, or want to maintain ratings, play counts and playlist membership. See this background thread , this post for detailed instructions and Please take note of the warning to back up your library before deduping.

    (If you don't see the menu bar press ALT to temporarily view or CTRL + B to keep displayed.)

    The latest version of the script can put away the dead links as long as there is at least a double live to merge his stats and membership of the playlist and must deal wisely when the same file has been added through multiple paths.

    TT2

  • How to duplicate an image and then put side by side

    How to duplicate an image and then put side by side

    This link might show the CS4 menu:

    Dual View Photo retouching in Photoshop tutorial

  • How to duplicate the composition that contains nested compositions?

    I know that if you duplicate the composition in the project the object containinf window will not be dependent on original model. But what about complex compositions that has nestled in 2, 3 compositions, how to duplicate the model of the root and make all the comps child separated from the original?

    http://aescripts.com/true-comp-duplicator/

    Mylenium

  • Restoration of openers program: how to restore the original program of opening such as internet explore and itunes instead of notepad ++

    on my computer, I have somehow changed the settings for applications on windows 7 open with notepad ++ how to restore the original program of opening such as internet explore and itunes instead of notepad ++

    I've seen this happen when opening a program via a shortcut (for example. LNK file), you are asked what type of program to open it with. After selection of Notepad ++ (or another program) via the Select a program from a list of installed programsand checking the always use the selected program to open this type of file, document or program referenced by the shortcut of origin opens in Notepad ++ as it should.

    The problem is that now all shortcuts (for example. LNK files) on the desktop or in the browser will want to open Notepad ++ and use the icon of Notepad ++ to display the shortcut no matter what shortcut was originally intentioned to open. This is known as a file association and the default icon.

    The good news is that a small free utility was written to cancel the. LNK file association was created. There is also a registry hack to achieve, but I recommend the utility unASSOC for its ease of use.

    A utility to Unassociate Types of files in Windows 7 and Vista

    Just download and then use the utility to unassociate the. LNK files. Manual is available on the web page above (the same place to get the utility). Quite simply, you run the program and wait for the list of the types of files to complete. Select. LNK in the list and then click delete the file type.

    Your asscoiations of moose file will be restored.

  • I use Photoshop elements on Windows 8.1 12.  When I go in the Expert Mode to change the available toolbar is displayed in a single column and missing several tools which foreground and background color.  How to restore the original toolbar?

    I use Photoshop elements on Windows 8.1 12.  When I go in the Expert Mode to change the available toolbar is displayed in a single column and missing several tools which foreground and background color.  How to restore the original toolbar?

    Try to re - set preferences.

    Go to: Edit > preferences > general (menu Photoshop Elements on Mac)

    Click on the button Reset preferences on the next launch

  • How to restore the original interface of first Pro CC and drag the video to the timeline?

    I downloaded the trial version doesn't have the video and audio tracks on the mounting Panel. I tried to play to find, but it's what happened instead.

    Print screen.png

    Can I know how to restore the original interface?

    Also, how do I drag videos to the timeline when it doesn't have any audio or video track line that I can work with, unlike the CS6 version I was using?

    Thank you.

    Hi Erica,

    To restore:

    In the menu items, choose window > workspace > reset Workspace

    To add the video to the timeline:

    • Select file > new > sequence and create a sequence. Drag the video to the new sequence.

    or

    • In the project Panel, drag your video to the new article . This will create a sequence that best matches your clips properties.

    Best,

    Peter Garaway

    Adobe

    Premiere Pro

  • iTunes has changed the order of songs on an album. How to restore the original order?

    I have a classic album. iTunes has changed the order of the songs. How to restore the original order?

    Order of songs is controlled by the number of drive and the beaches. Set them accordingly.

    TT2

  • Qosmio X 870 - 13p - how to restore the original key elements?

    Use the volume buttons + /-on the keyboard, I just had to push for example to increase the volume of your PC or put a song on a break. Now it does not work, I have to press the "Fn key" to use these keys.

    If anyone has an idea how to restore the original key elements?

    There are two options for the mode of function keys:
    -special function mode (you don't need to press the FN key n)
    -standard mode of F1 - F12

    Please check which option is set to your laptop.
    You can find it when you open the office assist > system settings > keyboard.

    Check and if necessary change the special function mode.

  • How to remove the original RAW files after deletion of the intelligent insights?

    Hello comrades!

    I have change my series of photos with smart thumbnails, disconnected my external HARD disk (where the original RAW files). I deleted some pictures from the catalog, and I now have only the best photos of "keeper".

    Could you help me please, how to remove the original rejection RAW from my hard drive external? If I connect my external hard drive and try to sync photos, LR offer me an import dialog box photos refused from the external hard drive, instead delete photos denied the original RAWs.

    Thank you very much!

    John

    Stop disconnect the external drive before you delete the catalog releases and select Remove from the disk.

    Otherwise, you will need to manually, delete them externally or reimport then them select all, make sure previous import is selected, Photos and then delete and remove disk.

  • How to get the original serial number to reload the program on the new computer?

    How to get the original serial number to reload the program on the new computer?

    Hi rehe,

    Please check the KB: quickly find your serial number to find your serial number.

    You can contact our support chat to help retrieve your serial number: serial number and activation support

    Kind regards

    Rave

  • set_item_property changing the text, but how to return the original value

    Hi all
    I use Oracle Forms Builder 10 gr 2 / I have the following problem: in a button I trigger when it is pressed. And then I change a few elements prompt text. But my problem is how to return the original prompt text. A kind of refresh or clear?


    Here is a piece of code that modifies the prompt text:
    set_item_property('XXBG_CE_STATEMENT_LINES_NEW.AGENT_NO', PROMPT_TEXT, get_item_property('XXBG_CE_STATEMENT_LINES_NEW.AGENT_NO', prompt_text) || '*');
    Thanks in advance,
    Bahchevanov.

    This is not tested, but it's something like this:

    declare
       v_item  varchar2(200);
    begin
       v_item := get_block_property('block',first_item);
       loop
          exit when v_item = 'block.'||null;
          set_item_property(...);
          v_item := 'block.'||get_item_property(v_item,nextitem );
       end loop;
    end;
    
  • How to keep the original path?

    How will keep the original path after conversion to describe stroke. Sometimes, but I don't know why?

    If the path has a fill it will be the path for the filling as well as the contours of the race. For closed paths that is.

  • How to add a JPG and move it around the Clipboard

    Sorry if this is newb as they come, but I'm new to PS and haven't slept in a day if I'm too tired to figure to play with it. Please help me. I'm trying to make a thing of jpg instructions and put some pictures to the Clipboard then put text next to the photo but every time I try to put a jpg file it will take up the whole screen and I can not understand how to resize and move it around. Thank you very much for the help.

    Use the file > place to import your images on existing canvas. You can see the handles around the picture angle handle allows you to scale the image.

    You drag the center of the image to a new location.

    On what scale you can hold the SHIFT key to constrain.

    When finished making the scale and press return movement to commit.

    If you need to do after committing, use ctrl-t on Windows or cmd - t on Mac to enter free transform mode. Press enter when finished.

  • How to duplicate the layer and rename it?

    Greetings to all.

    I do a little tool, and I need to duplicate the layer, change of name and so...

    Tell me how to change the name of the layer? After all, when duplicate layer app.activeDocument () of the range slider layer remains on the same layer. Can be done through hard brace, but I think that there is a simpler solution.

    Thank you

    Layers have a name property that can be changed via the Script.

    2014, use it at your own risk.

    #target photoshop

    If (app.documents.length > 0) {}

    theDoc var = app.activeDocument;

    var theLayer = theDoc.activeLayer.duplicate (theDoc.activeLayer, ElementPlacement.PLACEBEFORE);

    theLayer.name = "test";

    theDoc.activeLayer = theLayer

    };

Maybe you are looking for