Working on a script that will add a new work plan and remove the old if it is not a specific size

var app.activeDocument = docRef;

app.coordinateSystem = CoordinateSystem.ARTBOARDCOORDINATESYSTEM;

var ab = docRef.artboards [0];

If (((ab.artboardRect[2]-ab.artboardRect[0])/72) == 17) & & (((ab.artboardRect[1]-ab.artboardRect[3])/72) == 20)) {}

do nothing

}

else {}

docRef.artboards.add ([575,1601.78,1799,161.78]);

docRef.artboards.remove (0);

var abIdx = docRef.artboards.getActiveArtboardIndex ();

var actAbBds = docRef.artboards [abIdx] .artboardRect;

}

I mean it works about 90% of the time. I don't know why it does not always work, sometimes it will build the other work plan, even if it's the right size and I have no idea why. It's very frustrating haha. If anyone has an idea why it won't always work, please let me know. Thanks in advance!

Hi djbgraphicdesign,

Maybe this could be a rounding problem.

Please try something like this instead

if ((Math.round((ab.artboardRect[2] - ab.artboardRect[0]) / 72) == 17) && (Math.round((ab.artboardRect[1] - ab.artboardRect[3]) / 72) == 20)) {

Tags: Illustrator

Similar Questions

  • Reorganize work plans and move the work hidden with both work plan?

    Is it possible to use the option to "Reorganize the work plans" in the dropdown to work plans and also the movement not only the plan of work itself, but also the hidden work (layers, objects, etc.) on this work plan?

    I tried marking check the option 'move illustration with work plan' , but that still does not move the hidden work. The default behavior seems to be that only the active or visible work is moved with the artboard, but the work of hiddden is left behind somewhere on the workspace where the work plan used to be before it was moved.

    I find it a little heavy, because I often hide work that I test and have to do all visible again to move them just with the artboard would break the dinstinction between all many very similar layers, objects, etc. that I could work with at any given time.

    If anyone has some advice please chime...

    Hahaha... your memory is better that an elephant Kurt, but remember that I already have this script of cardiac arrest?

    http://forums.Adobe.com/message/5666490#5666490

  • I have 6 LR on my desktop and notebooks (as the license allows). Just got a new laptop computer and uninstalled the old laptop, but now I get the error that I have to disable a computer before I can activate on my new machine. How can I disable an instanc

    I have 6 LR on my desktop and notebooks (as the license allows). Just got a new laptop computer and uninstalled the old laptop, but now I get the error that I have to disable a computer before I can activate on my new machine. How can I disable an instance that has already been uninstalled? Thank you!

    You are now logged for all activations.

    You can activate (sign) on 2 installations simultaneously.

    Let me know if you still have a problem.

  • How to add a member in planning to delete the old one?

    Hi all

    We load the metadata in Hyperion planning by ODI. In the form of metadata, we are also loading ADU by defining certain logic in ODI. We have a requirement where we update UDAs some members so that remove old Adu for this member. I am not able to do. Can someone help us please to remove the old Adu from a member through ODI when a new UDA is getting added to this member.

    Example:

    Assume that ACCT_A has UDA 'Active' in planning.
    While re-running the metadata through ODI, ODI evaluates its UDA to be "inactive". Now normally ODI will add 'Inactive' UDA that Member, but this does not alter the UDA 'Active '. If planning is to have the two 'active' and 'Inactive' UDA scored for the ACCT_A.
    Is it possible to remove this member UDA 'Active' when the 'Inactive' UDA by ODI definition.

    Concerning
    Maury

    You may need to update the members twice, once to remove the UDA, then insert the new UDA
    To remove the use of the UDA in the column of the UDA.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • is it possible to write a script that will display the script files folder in the tree

    is it possible to write a script that will display the script files folder in the tree

    Yes :-)

    In your previous post, someone suggested to search for the file "SnpCreateTreeview.jsx", because it would just be the asked.

    The script can be found here, just accept the EULA and download the example scripts of Bridge CS3. (For some reason it is not in CS4 samples because as far as I know)

    Here's a version with small changes, it is up to you to point the script in the folder 'root' right, because this is, needless to C: on PC:

    ////////////////////////////////////////////////////////////////////////////
    ADOBE SYSTEMS INCORPORATED
    Copyright 2007 Adobe Systems Incorporated
    All rights reserved
    //
    NOTE: Adobe permits you to use, modify, and distribute this file according to the
    the terms of the Adobe license agreement accompanying it.  If you received this file from one
    source other than Adobe, then your use, modification or distribution of it is required in advance
    written permission from Adobe.
    /////////////////////////////////////////////////////////////////////////////

    /**
    @fileoverview shows how to use an item in the tree list and how to capture events with
    functions of recall or script registered event listeners.
    @class shows how to use an item in the tree list and how to capture events with
    functions of recall or script registered event listeners.

    Its use


      
      
      

        
    1. Run the extract in the ExtendScript Toolkit (see Readme.txt).
         
    2. Enlarge / reduce the list items
         
    3. Check the JavaScript Console to see the events captured by the elements of the TreeView.
       

    Description


     
     

    Creates two hierarchical list of TreeView items. One is static, with a fixed set of point
    nodes that you can expand and collapse. The other is dynamic; Item nodes are added and removed as
    the need for a view of the file system.
     
     

    The list items in the TreeView control to display the folders and files custom images.  When you add items to the
    TreeView list, type 'article' is used for elements of the leaf and 'node' to the elements of the container.
     
     

    Dynamic TreeView captures events in two different ways. It uses callback functions to capture the
    node to expand and collapse events and selection changes and also registers an event listener to
    capture double-click events.

    @constructor constructor
    */
    #targetengine "session".
    function SnpCreateTreeView()
    {
    /**
    The context in which this code snippet can work.
    @type string
    */
    this.requiredContext = "\tNeed runs in the context of the Bridge\n."

    /**
    The location of this script file system
    @type file
    */
    var scriptsFile = new File($.fileName);
       
    /**
    The location of the file system resource PNG file used to represent folders
    @type file
    */
    this.folderIcon = new file (scriptsFile.path + "/ resources/Folder_16x16.png");

    /**
    The location of the file system resource PNG file used to represent files
    @type file
    */
    this.fileIcon = new file (scriptsFile.path + "/ resources/Story_16x16.png");

    /**
    The root folder that will be used for the dynamic tree
    @type string
    */
    this.rootFolder

    If (File.fs is "Windows")
    {
    this.rootFolder = "C:";
    }
    on the other
    {
    this.rootFolder = ' / ';.
    }
    }

    /**
    Functional part of this code snippet. Creates the ScriptUI window and its components,
    and defines the behavior.
    @return true if the code snippet is executed as scheduled, false otherwise
    Boolean @type
    */
    SnpCreateTreeView.prototype.run = function()
    {

    $.writeln ("about to"run SnpCreateTreeView");
       
    Create the window
    var win = new window ("palette", "SnpCreateTreeView", undefined, {resizable: false});

    Create the Committee for the static TreeView control
    sPanel var = win.add ('Committee', undefined, 'TreeView Élément') static;
    sPanel.alignment = ["fill",""];
    sPanel.alignChildren = ["fill",""]

    Create a TreeView list
    sTv var = sPanel.add ("treeview");
    sTv.preferredSize = (300, 200);
    Add static items to the list, in a hierarchical structure.
    for (var i = 0; i)<>
    {
    sTv.add ("node", "Item" + i);
    for (var j = 0; j)<>
    {
    sTv.items [i] .add ("item", "Sub Item" + j);
    }
    }

    Create the Committee for the dynamic TreeView control
    var dPanel dynamic = win.add ('Committee', undefined, 'TreeView Élément');
    Create a TreeView list
    TV digital var = dPanel.add ("treeview", undefined);
    dTv.preferredSize = (400, 300);
    Create the root node element
    var aNode = dTv.add ("node", "/");
    Pair it with an image of the icon
    aNode.image = this.folderIcon;

    Define a handler for the double clicks
    myOnDoubleClick = Function
    {
    if(e.detail == 2)
    {
    $.writeln ("double click");
    }
    }

    Adds the handler as an event listener to the TreeView element.
    dTv.addEventListener ("click", myOnDoubleClick);

    Keep a reference to this object
    var that = this;

    Define an event handler for when a node is expanded
    dTv.onExpand = function (point)
    {
    $.writeln (item.text + "is now expanded.");
    nextItem var = item;
    var path = "";
    goUp var = true;

    While (goUp)
    {
    path = "/" + nextItem.text + path;
    nextItem = nextItem.parent;
    If (instanceof TreeView nextItem)
    {
    goUp = false;
    }
    }

    Remove all children of this element
    item.removeAll ();

    var Ref = new file (that.rootFolder + path);
    If (Ref instanceof Folder)
    {
    children var = ref.getFiles ();
    for (var i = 0; i)<>
    {
    If (children [i] instanceof file)
    {
    Item.Add ("node", children [i] p:System.NET.mail.MailAddress.DisplayName);
    Item.Items [i] .image = that.folderIcon;
    }
    on the other
    {
    Item.Add ("item", children [i] p:System.NET.mail.MailAddress.DisplayName);
    Item.Items [i] .image = that.fileIcon;
    }
    }
    }
    }

    Define an event handler for when a node is reduced
    dTv.onCollapse = function (point)
    {
    $.writeln (item.text + "is now reduced.");
    }

    Define an event handler for when the selection changes
    dTv.onChange = function()
    {
    $.writeln ("selection changed");
    }

    Display the window
    Win.Show ();
       
    $.writeln ("Ran SnpCreateTreeView");
       
    Returns true;
    }

    /**
    "main program": construct an anonymous instance and run
    as long as we are not unit - test this code snippet.
    */
    If (typeof (SnpCreateTreeView_unitTest) == 'undefined') {}
    new SnpCreateTreeView () .run ();
    }

  • Looking for Advanced Action script that will close the project

    Hi all

    It seems so simple but I can't seem to understand. Does anyone know of scripts that will cause the project to close when the user clicks a button? I have a project built in 6 Captivate that is set to close its 'End of the project' preferences and has multiple options of branches. I want to have a button to END that will close the entire project. The best that I got is simply apply an action of 'CONTINUE' on the last slide, but since this slide also includes a button that jumps to another branch, the blade simply crashes when you click the END button.

    Any thoughts?

    Krista

    You can use a 'Execute JavaScript' action with the script below:

    window.close();
    

    OR

    window.top.close();
    

    What script you use depends on how your LMS launches your course.  If it is in the main window, use Window.Close ().  If it is in a window child, then window.top.close ().  If you are not sure, then a little experience by downloading a course of a slide with two buttons.  The first button must execute Window.Close (); and the 2nd button must execute window.top.close ();.  When your LMS is launching the course, try the buttons and see one that works.

    F12 (Web Preview) will not give you a solid test since your LMS can launch your course differently... it's the kind of thing that should be tested in your LMS to be sure it works.

    Jim Leichliter

  • Can I add a button next to the bar of address (such as the Home key) that will open a new tab?

    In Firefox 3, there was a button that would open up a new tab. This button was close to my address (next to the home, refresh, buttons etc.) bar and can also be used when I had no open tag (unlike the + on the tabbar, who is only there when I turn on my tabbar).
    Although there is a button I can add that will open a new window, I would like to know if it is possible to have a similar button that will open a new tab.

    https://support.Mozilla.com/en-us/KB/how+to+customize+the+toolbar

    There is a button tab in the Customize Palette, simply move it to a location of your choice.

  • Need a script that will provide details of concurrent applications that took place beyond the avg time of execution.

    Hi guru - it will be really useful, if so can provide a script that will get details of concurrent applications that went beyond the avg time of execution.

    Thank you

    Are you after something like this? Last column shows the average too.

    select FCP.user_concurrent_program_name
          ,FCR.argument_text
          ,FCR.completion_text
          ,to_char(FCR.actual_start_date,'DD-MON-YYYY HH24:MI:SS') start_time
          ,to_char(FCR.actual_completion_date,'DD-MON-YYYY HH24:MI:SS') end_time
          ,ROUND((FCR.actual_completion_date  - FCR.actual_start_date)*86400) time_in_sec
          ,ROUND(AVG_VALUES.avg_time) AVG_TIME_IN_SEC
    from fnd_concurrent_requests FCR
        ,fnd_concurrent_programs_vl FCP
        ,(select  FCR1.concurrent_program_id
                 ,avg((FCR1.actual_completion_date  - FCR1.actual_start_date)*86400) avg_time
          from fnd_concurrent_requests FCR1
          group by FCR1.concurrent_program_id) AVG_VALUES
    where FCR.concurrent_program_id = FCP.concurrent_program_id
    and   (AVG_VALUES.concurrent_program_id = FCR.concurrent_program_id
           and
           ((FCR.actual_completion_date  - FCR.actual_start_date)*86400) > AVG_VALUES.avg_time)
    ORDER BY FCR.concurrent_program_id,FCR.actual_start_date desc;
    

    See you soon

    AJ

  • Hello. I need help developing a PowerCli script that will show me the current configuration of the video Ram of each individual virtual machine on a host\cluster or a vcenter. Can you help me?

    I have a script that will allow me to change the configurations of VRAM, but I need a script that retrieves the configuration of all virtual machines VRAM in my infrastructure.
    I need to get out information to a csv file and run this report on a monthly basis... can you help me?

    Right now my environment is mixed. I have Windows XP virtual machines set to 4 MB, Windows 7 virtual computers set to 8 MB and a subset of sall of virtual machines set to automatic detection of settings.

    I need to be able to recover these settings in a CSV file in order to use this information for comparisons of trdouble-shot performance issues...

    Thank you.

    vram.JPG

    Try something like this

    Get - VM |

    Select Name,

    @{N = "OS"; E={$_. ExtensionData.Config.GuestFullName}},

    @{N = "VideoRamMB"; E = {}

    [math]: Round (($_.)) ExtensionData.Config.Hardware.Device |

    where {$_-is [VMware.Vim.VirtualMachineVideoCard]} |

    (Select VideoRamSizeInKB - ExpandProperty) / 1 Ko, 1).

    }} |

    Export-Csv vm - videoram.csv - NoTypeInformation - UseCulture

  • I just wrote about firefox 3.6 with 5.0 for my mac OSX and discovered that my mac will not support it. Is there a way I can recover my lost files and recover the old version?

    I just wrote about firefox 3.6 with 5.0 for my mac OSX and discovered that my mac will not support it. Is there a way I can recover my lost files and recover the old version?

    You can download and install Firefox 3.6 http://www.mozilla.com/firefox/all-older.html

  • When I use Hotmail and try to attach a document to send by email, I get a message error that says 'attachment Id has wrong format", and if the message will not be sent.

    The attachment ID has wrong format.

    When I use Hotmail and try to attach a document to send by email, I get a message error that says 'attachment Id has wrong format", and if the message will not be sent.

    I have had absolutely no problem in electronic documents before sending.

    Please help, thanks.

    Hello KerJJ,

    The best place to ask your question of Windows Live is inside Windows Live help forums. Experts specialize in all things, Windows Live, and would be delighted to help you with your questions. Please choose a product below to be redirected to the appropriate community:

    Windows Live Mail

    Windows Live Hotmail

    Windows Live Messenger

    Looking for a different product to Windows Live? Visit the home page Windows Live Help for the complete list of Windows Live forums to www.windowslivehelp.com.

  • If you use Hotmail, I try to send an e-mail, I get a message error that says 'attachment Id has wrong format", and if the message will not be sent.

    "Attachment Id has wrong format", we hear wat!

    If you use Hotmail, I try to send an e-mail, I get a message error that says 'attachment Id has wrong format", and if the message will not be sent.  I use the Google Chrome or internet explore and cannot send new or respond to emails without getting the same message... help plsssssemai

    View all Windows Live and Hotmail questions in the appropriate forum found here:
    http://windowslivehelp.com/

  • I have a program that I can't remove. its not in Add and remove the progeams

    I have a program that I can't remove. its not in Add and remove the progeams

    It may be a small program which do not present in the Add Remove Programs list.

    Try to get into the programs folder, and then delete the folder with the name of the program on this subject.
  • Impossible to update LR CC ~ my one day to change and nothing work updated my Mac and all LR will do is CRASH!  Need help.  Tried to stop CC and remove the 1.0 file already and who does not work for me.  What can I do?

    Impossible to update LR CC ~ my one day to change and nothing work updated my Mac and all LR will do is CRASH!  Need help.  Tried to stop CC and remove the 1.0 file already and who does not work for me.  What can I do?

    If lr crashes repeatedly, reset preferences.   http://www.lightroomforums.NET/showthread.php?14226-resetting-%28or-trashing-%29-the-light file-Preferences-room

  • How to get a product key, that I had a new hard drive installed in the computer shop and it seems that there is no key for windows 7

    Original title: window 7

    Hi can one tell me how to get a product key, that I had a new hard drive installed in the computer shop and it seems that there is no key for windows 7, I just brought Office 2016 and he did not finish the load down with the windows key 7.

    Because Windows 7 is in limited stock because Microsoft ended sales in October 2013, this created demand due to its rarity. This means the retail boxed copies request a bonus, while the OEM System Builder copies remain affordable.

    Full version (retail):

    -Includes the rights of transfer to another computer.

    -Does not require a qualifying earlier version of Windows.

    -Expensive

    Upgrade version (detail):

    -Includes the rights of transfer to another computer.

    -require a qualifying earlier version of Windows.

    -Expensive, but less expensive full version

    OEM System Builder version:

    The OEM of Windows 7 versions are identical to the versions commercial full license with the following exception:

    -OEM versions don't offer any free direct support from Microsoft technical support Microsoft

    -OEM Licenses are tied to the computer first you install and activate it on

    -OEM versions allow all hardware upgrades except for an upgrade to a different model motherboard

    -OEM versions does not move directly from an older Windows operating system

    There is nothing wrong to use it too, especially that all future versions of Windows will be full versions.

    You can find software OEM System Builder of dozens of online merchants. The current price for OEM Windows 7 Professional Newegg, for example, is $ 140. When I checked a few minutes ago, Amazon offered packages OEM Windows 7 Professional from several vendors at prices ranging from $ 101 to $ 150. When I checked earlier, a package specifically designed for reconditioned PCs cost only $ 50 for a 64-bit copy.

    There is no technical limitation to prevent you from using OEM software on your computer, although this software only works for a clean install, not an upgrade. In the past, Microsoft has been remarkably inconsistent in his advice to clients on the question of whether this practice is allowed. (See "is allowed to use Windows OEM on your own PC? Don't ask Microsoft. »)

Maybe you are looking for

  • I can't get credit cards to load to watch for Apple payroll

    When you try to synchronize the credit cards at Apple Watch to pay Apple, my phone just continues to load, but it never appears on my watch.

  • 2.2 on motorola milestone of Israel:

    Hi, what's up? I Israel and a month ago I buy the motorola milestone a8533 (its look like the droid phone) my version of android and its 2.1, 2.2 or 2.3 update will arrive in Israel sometimes [if so, when]? and why does take a lot of time to update?

  • I want to reinstall Windows XP pro but can't find winnt32.exe. Where would it in XP pro?

    Reinstall windows xp Hi all I want to reinstall windows xp. I am able to find the product key, but not the winnt32.exe Setup program. Please let me where it would be in windows xp professional. Thank you & best regardsGauri

  • lock the mouse button does not work

    It worked fine until a few weeks ago.  Now, I need to left-click while using the touch of the finger. I'm going to: mouse properties, buttons, lock, turn on click-lock and ok.  It does not help.  Thank you.

  • The initialization of the external hard drive

    I don't see the external hard drive, WD450AA, in an enclosure closed when I look in the directories of the computer, but I can see it under "Disk management" in the management of the computer.  This drive came a Compac and still has XP on it.  I have