Random removal with Scriptographer tool

Hi, I'm trying to tweak the RandomTools created to Scriptographer so that it matches my preference, but I can't understand it in Javascript. Not knowing a lot of Javascript does not bring me either!

Here's the script, simplified kept only the part to be deleted. What I want to do is enter a percentage, and then what would be the percentage of the selected object deleted.

If someone could point me in a direction with which, it would be really great.

/**
 *  randomDelete 0.4
 *  Base on
 *  Ken Frederick
 *  [email protected]
 *  http://cargocollective.com/kenfrederick/
 *  http://kenfrederick.blogspot.com/
 *
 *  Modified by Jolin Masson
 *  http://jolinmasson.com/
 *
 *          this script uses stuff borrowed from keegan's "rando-color.js"
 *          as well as from some other things i had written in processing
 *
 */


script.coordinateSystem = 'bottom-up';
script.angleUnits = 'radians';


var sel;


var values = {
          b_delete: true,
          val_deleteAmt: 2,
};


// gui components
var components = {
          b_delete: { 
                    onChange: function(value) {
                              components.val_deleteAmt.enabled = value;
                    }
          },


          val_deleteAmt: { 
                    type: 'number',
                    fullSize: true,
                    enabled: true
          },


          deleteRule: { 
                    type: 'ruler',
                    fullSize: true,
          },


          submit: { 
                    type: 'button', 
                    value: 'Apply',
                    onClick: function() {
                              Main();
                    }
          }
};


// Setup
function Setup() {
          // initialize the palette window
          var palette = new Palette('Random Delete 0.5', components, values);
}


// Update
function Update() {
}


// Main
function Main() {
          // document properties
          sel = activeDocument.getItems( { type: Item, selected: true } );


          //adjust delete range values based on selection number
          components.val_deleteAmt.range = [0, sel.length-1];


          // loop through selected items
          for ( i in sel ) {
                    var object = sel[i];


                    if( object.isValid() ) {
                              // ------------------------------------
                              // delete
                              // ------------------------------------
                              if ( values.b_delete ) {
                                        rand = parseInt( Math.random()*values.val_deleteAmt );
                                        if (rand == 0) object.remove();
                              }
                    } //end isValid()
          }
} //end Main()




// ------------------------------------------------------------------------
// methods
// ------------------------------------------------------------------------
function random(minr, maxr) {
          return minr + Math.random() * (maxr - minr);
}




// ------------------------------------------------------------------------
// execution
// ------------------------------------------------------------------------
Setup();
Update();

Thank you

I had help on the forum Scriptographer, and here's the final stuff!

http://CL.LY/code/3y1u1q311T1x

Tags: Illustrator

Similar Questions

  • computer started to randomly restart. What to do with the tools I have to try to find what is wrong?

    I am running Windows XP sp3, out of nowhere, my computer started to randomly restart. What to do with the tools I have to try to find what is wrong?

    Hello ccsmudge,

    Often, we see crashes as a result of a program from loading at startup.
    To solve these, we use the clean boot troubleshooting.
    The following describes this process:
     
    In addition, if you can zip the contents of the c:\Windows\minidump folder and put it on a public folder to http://skydrive.live.com , then we can take a peek to see if and why we are bluescreening and restart all of a sudden.
     
    Best regards
    Matthew_Ha
  • Help: Contacts randomly removed from my list

    Contacts delete randomly my contacts from time to time and when I log out of Skype...

    I contacted the live chat and they told me to change my password, then they have accessed remotely in and na not at all, helpp then disappeared.

    Today I contacted one who told me to change my password, I told them that did not help

    then they said now of "wanting to change your password"

    So, those who do not work. Help, please.

    Topic/title edited for clarity.

    Maybe your local Skype contacts database is corrupted.

    Try Skype with my tool cleaning data: http://www16.zippyshare.com/v/68099559/file.html

  • EliteBook 8460p nootbook: uninstall hp protect access to the tool Device Manager to remove HP protect Tools Security Manager

    I'm trying to update my Windows 10 computer and it says I need to remove "HP protect tools security Manager. I had to first remove the other programs, but now I can not remove the last "HP protect tools Device Access Manager" program a window pops up saying: you must be an administrator which I am on my computer. help please

    Tell him that you get another account with administration full wrights

    https://www.YouTube.com/watch?v=3NiTNj1pm2o

    made easy and you can uninstall everything, you need to activate this account when you are finished

  • BlackBerry Smartphones Random removal of e-mails

    I also have random problems with removal of e-mails.  I read all the previous discussions on the free memory and the measures for solutions.  It did no good.  All of my associates have the same phone, same settings, less memory and do not experience this problem.  File: 43985492

    Thank you.  I did this and to reconcile the disabled wireless.

    Everything works fine.

  • I get random stops with my recordings on Widows Media Center.

    Original title: Smart TV with Windows Media Center Recordings interference

    Since the installation of a new Samsung Smart TV (model UN46ES8000F) I have been making random stops with my recordings on WMC.  Because there are a lot of tuners and available memory at the time where the records are arrested, they record not 'conflicts' in the sense of the WMC.  Records are simply stopped manually at random times when recording provided by another component on my computer in the home network. Today, I tried to reload WMC, a full charge of Windows 7, complete diagnosis on all equipment running & exchanging a few components; But starting today, I was not able to specifically identify the component that prevents the records, however, I begin to suspect the smart terminal on the new TV.  I have photos available of history showing the partial records should anyone want to consult them.

    Description of the system: I use wired (Cat5E) Linksys DMA 2000 ex distribution TV recorded on my first HDHomeRun in 4 different rooms in my house since my computer Dell XPS420 (under Windows 7 Ultimate) via a D-link DGS-2205 gigabit switch.  The Smart TV is connected to the internet via my router D-link DIR - 655 Wireless-N.

    Everyone knows about this problem, and no one knows a way to solve it?  Do not hesitate to contact me directly at * address email is removed from the privacy *.

    I too began to see problems with my Windows 7 Media Center after buying a "smart tv".

    I am using an HDHomerun Prime with 2 pc for more than a year and practically no problem.  Now, I use it with a Ceton Extender so... no problem.  But when I got my first smart (a 55 '' TV LG LED 120 MHz) model, the problems started.

    Whenver my new flat screen is connected to my network (cat6, 1000Mbps), I noticed a ton of problems with my 3 tuners.  All three tuners "disappear" and whatever program I was watching would freeze.

    I didn't record something while my smart tv is connected to my network, so I can't say I have the same problem you are having, but I sincerely believe that we are the same.  For the sake of arguments, if I recorded something, it probably would have stopped.

    I agree with you 100%.  I think the smart TV is guilty.  I think the problem is our TV are the first hdhomerun and treat it as one product DLNA.  Under my smart TV App menu, I can see the shared folders on various pc's on my network (music, videos, etc.). .. as well as three files for each tuner hdhomerun main!  When I click on one of the tuner, my TV resets icon.  Something tells me that when the smart tv is connected to my home network, he's trying somehow communicate with three tuners and which is originally the tuners to freeze.

    If Silicondust would somehow a patch update or firmware to avoid the first appearing as a product DLNA, which can solve our problems.

    I think that Silicondust would be able to help you with this problem.  I doubt that microsoft technicians will have a clue.

    The silicondust techies will be most useful, especially since they want to certify our hdhomerun first tuners like DLNA Certified products as we speak.   If you do a search on the web for first hdhomerun and DLNA, you will see an article/news update on progress.

  • With what tools/plugin can I do a similar drawing? With this plugin / tools can I do a similar design?

    Hello everyone, I come to you because I need to create this kind of drawing (see the joint url) pour cut a laser on steel.
    More exactly I want to create random shapes but that if a minimum as brick pour a puzzle and a large area of this on.

    This is the result I'm looking for: http://www.atmosfer-creation.fr/savoir-faire/d%C3%A9coupe-laser-0

    a style of model I found but which did exactly as I wish. https://Fr.Fotolia.com/ID/70382145

    Kind regards

    Hello everyone, I come to you because I need to create a drawing for a laser cutting. I want a result like this: laser cutting | Service

    I am looking for a tool or plugin to draw this random shape with this principle of locking as a puzzle.

    Another example: "Abstract futuristic background" rights on the images Fotolia.com - 70382145 Image Bank free vector file

    You can try the Photohoshop mosaic effect. Then expand and then to autotrace the result. Maybe or maybe not out exact.

  • Tools of change randomly to previously used tools

    Hi all

    I'm running into a very strange and frustrating problem in Photoshop CS6 (running on a Macbook Air with OS X version 10.8.5).

    When you use keyboard shortcuts to switch backwards between tools, Photoshop will be randomly my tool used previously. For example, I have the active move tool and use it to move items in my PSD. Then, I turn to the text tool by using the 't' shortcut on my keyboard. I go to click on the type I want to change, and Photoshop, has been my active tool to the move tool. I type 't' again to pull the top of the text, in 1 or 2 seconds tool, Photoshop jumps me to the move tool. It's as if I pressed the 'V' shortcut that is immediately after the pressing, the shortened 't'! Sometimes I have to type 't' to shoot to the top of the type tool 8 or 10 times before the tool of type "sticks".

    This is the case with other tools, too (switch between Move tent, tent & direct selection, Zoom & Move, etc.) is not only limited to switch between Move & Type.

    I do not see the same question when you click on the toolbar to select a new tool (instead of going via the keyboard shortcut).

    Anyone else see this issue? Does anyone know a fix?

    I had a lot of problem with that. Russell Williams from Adobe gave me this fix a few days ago:

    He said to edit a file called PSUserConfig.txt in the PS settings folder. If one does not exist, create a text file with this in it:

    SpringLoadedKeyTime 2000

    I change the time from 2000 to 8000.

    You can find the file here:

    If, on Mac, in Photoshop ~/Library/Preferences/Adobe CC settings 2015

    Since the library folder is hidden by default, type Cmd + G in the finder and paste

    ~/Library/preferences/Adobe Photoshop CC 2015 parameters

    in the box.

    Under Windows,.

    C:\Users\\AppData\Roaming\Adobe\Adobe Photoshop 2015\Adobe Photoshop CC 2015 settings CC

  • Play with vmkiscsi-tool options-A m

    Hello

    Is anyway n configuring chap (user name and password) using the line comand with vmkiscsi-tool?

    I've been playing this comand unsuccessfully

    Any help would be greatly appreciated.

    Saludos,

    Jose Maria Gonzalez,

    -


    http://www.JmGVirtualConsulting.com

    http://www.josemariagonzalez.es

    VMware vExpert 2009

    -


    If you find this or any other answer useful please consider giving points by checking the answer useful or appropriate.

    http://feedproxy.google.com/ElBlogDeVirtualizacionEnEspanol.2.gif[http://www.josemariagonzalez.es: http://feedproxy.google.com/ElBlogDeVirtualizacionEnEspanol]

    I think you might be the bad parameter for iSCSIID, take a look at the comment left on this blog post by Scott Lowe: http://blog.scottlowe.org/2007/06/29/esx-iscsi-basic-configuration-from-the-cli/

    It seems that you must pass in the vmhba, new since vmware-vim-cmd is not supported by VMware, it's not very well documented and unfortunately I haven't played with this specific option myself, but it looks like it was possible.

    Also in looking at vmkiscsi-tool, have you taken a glance at the subcomands:

    Subcommands
                   -l --list
                   -r --remove
                   -a --add
                   -m --authMethod : specify method for add/remove
                   -b --mutual CHAP
                   -j --persist changes
                   -y --dynamic discovery CHAP
                   -x --static discovery CHAP
                   -f --flag: set a discovery or authentication flag
                   adapterName
    

    Looks like param m would allow you to activate the CHAP protocol, and I guess that's the argument... I only raise this question because the vCLI esxcfg-iscsi has similar params and I guess it should be similar to the version of the SC but do not know if this applies only to software iSCSI vs.

    =========================================================================

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    repository scripts vGhetto

    VMware Code Central - Scripts/code samples for developers and administrators

    http://Twitter.com/lamw

    If you find this information useful, please give points to "correct" or "useful".

  • As I was deleting some files from my hard drive, I came across some files that I couldn't remove with a message saying remove wite protection.

    As I was deleting some files from my hard drive, I came across some files that I couldn't remove with a message saying remove wite protection. Help!

    This error indicates that an application is using this file at this point here. If you are unable to remove it, restart your computer and then try to delete it.

    IF YOU ARE NOT SUCCESSFUL WITH THE above METHOD, THEN TRY to USE UNLOCKER, a free application that disables the application using the file that you want to delete.
    Download unlocker from here-http://www.filehippo.com/download_unlocker/
    Click on the above link and click on download the newer version on the right side of the screen.
    Download UNLOCKER from the link given above and install it. (you may need to restart the computer)
    Right-click on the file you want to delete, and then click unlocker.
    A new window opens showing all applications using this file.
    Select all files, and then click on unblock.
    Now right-click on the file you want to delete, and then click on remove.
    YOUR FILE WILL BE DELETED SUCCESSFULLY.
    If you are still unable to delete that file and unlocker shows no application, then follow these steps-
    Right-click on the file you want to delete and click unlocker.
    A small window will appear.
    In the drop-down list, choose delete, and then click ok.
    Your file will be deleted on the next reboot of the system.
  • MS Paint "fill with color" tool does not work. :(

    In the painting, my "fill with color" tool (the pouring paint can) does not work. I click on the box, I click on a different color, the icon changes to the can, but when I click on a space as say an empty circle, it doesn't do anything. Right click, nothing, left click, nothing.

    I noticed that the only thing he is able to do is to change a solid color that I did (as a solid black rectangle) in a different color, but only once. If I rectangle black color green, I can't change it to any other color after. I don't know what is happening.

    I am not edit a photo or anything btw, I start a new painting from scratch file. I'm trying just to circles of color and enclosed spaces. I've done this dozens of times with no problems. I tried restarting the computer and paint without effect.

    Thanks for any help!

    In the painting, my "fill with color" tool (the pouring paint can) does not work. I click on the box, I click on a different color, the icon changes to the can, but when I click on a space as say an empty circle, it doesn't do anything. Right click, nothing, left click, nothing.

    I noticed that the only thing he is able to do is to change a solid color that I did (as a solid black rectangle) in a different color, but only once. If I rectangle black color green, I can't change it to any other color after. I don't know what is happening.

    I am not edit a photo or anything btw, I start a new painting from scratch file. I'm trying just to circles of color and enclosed spaces. I've done this dozens of times with no problems. I tried restarting the computer and paint without effect.

    Thanks for any help!

    salés

    try to run the sfc/scannow command. to repair the corrupted system files

    http://support.Microsoft.com/kb/929833

    Use the (SFC.exe) System File Checker tool to determine which file is causing the problem and then replace the file. To do this, follow these steps:

    1. Open an elevated command prompt. To do this, click Start, click principally madeprograms, Accessories, right-click guest, and then click run as administrator. If you are prompted for an administrator password or a confirmation, type the password, or clickallow.
    2. Type the following command and press ENTER:
      sfc/scannow

      The sfc/scannow command analyzes all protected system files and replaces incorrect versions with appropriate Microsoft versions.

    Walter, the time zone traveller

  • Unable to turn on the window Defender, even after that I click on activate the defender of the window. THA page with the tool does not appear...

    Unable to turn on the window Defender, even after that I click on activate the defender of the window on my window vista home premium... The page with the tool does not appear...

    If you have
    one of the following AV, antivirus, programs installed, it will stop your
    Windows Defender. Purpose of these AVs have their own advocates. 2 defenders
    on the same machine will create conflicts.
    Bottom line: it's ok.
    It's normal.
    List of AVs which will stop Windows Defender

    Norton
    McAfee
    AVG
    Microsoft Security
    Essentials

    If you do not have the
    above AV programs, here's how to do to restart Windows Defender:

    Start button > in the search box, type Services > press the Enter key > scroll to find Windows Defender, click on it >...
    topic status , it must be said... Has begun
    under Startup Type, it must be said... Automatic
    If it does not say that, right click on Windows
    Defender > click Properties > to
    Startup type, click on the pointer to the right and select automatic
    to the service status, click Start
    Click OK when finished.

  • Print screen with Snipping Tool does not.

    Print screen or capture tool work.  They worked very well in the past, but now neither one works.  Back to zero does not solve the problem.

    Screenshot doesn't seem to do anything in the copy buffer because even if the block occurs, nothing sticks in.

    Snipping Tool just shows a black with a red around him border screen, instead of the actual screen shot (no matter the option I select IE free Style or whole screen, etc.), I have Vista Home Premium with all service packs.

    Thank you

    This should be the final resolution to my problem of Snipping Tool/print screen:

    1. I downloaded and ran the Malwarebytes program as recommended.  And BTW, I don't see this recommendation here.  I'm fairly new participant in Forums, so maybe there's a reason that I see here this recommendation I don't know.  The Malwarebytes has really done his job and even if I run MS Essentials program found Malwarebytes 25 hits of Mal-ware on this PC.  Once I have it fixes these problems, the symptoms of my problem of Snipping Tools became less consistent.

    If Malwarebytes fixed part of the problem with the Snipping incroyables.* *.

    2 but the final resolution is that it turns out that there is that one Internet site where the tool captures will not work and it is my Bank.  I know that my Bank suggested I run a program called safety report.  It's my theory that is my bank site or report has something programmed into it that prevents screen either with the tool to capture and print screen captures.  If I go into my bank site with Internet Explorer or Mozilla Firefox, the Snipping Tool will not work.  However, the Snipping Tool works everywhere else.  It's all the other websites and in other programs.

    The Snipping Tool does not work on my banking site (probably because of the REPORT) and maybe it will not work on other sites closely to secure *.

    Thank you very much for the help.

  • Repair Windows without having to start, but with the tool of reliable micro-soft

    Question:

    How can I repair my windows lack of files without any boot device. I want to repair it with a tool flexible microphone. Is this possible? If the answer is "Yes"; then please share everything in detail.

    Press the F8 key at startup high and choose one or several repair options several times.

  • How do I optimize the performance of windows 7 with freeware tool or tool?

    How do I optimize the performance of windows 7 with freeware tool or tool?

    Hello

    As Frederik advised, saving No. tune-up, not so-called Optimizer program, no registry cleaners should be used.

    See if this helps you improve performance.

    Search for malicious software with the FREE version of this program.

    This is the right link to download included.

    And does not accept the option "Pay for the version" trial installation

    Download, install, update and scan your system with the free version of Malwarebytes AntiMalware:

    http://www.Malwarebytes.org/products/malwarebytes_free

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    You can clean your hard drive using these two methods.

    "Delete files using Disk Cleanup"

    http://Windows.Microsoft.com/en-us/Windows/delete-files-using-disk-cleanup#delete-files-using-disk-cleanup=Windows-7

    Using the free CCleaner program:

    http://www.Piriform.com/CCleaner

    In NO case use the registry cleaning Option in CCleaner

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    And it is not recommended to use a register or a program of cleaning/TuneUP/utilities they can do more harm to your any good operating system that they claim to be able to do.

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    Make sure you have the latest updated drivers:

    Access the site on your computer or equipment manufacturing > Driver and Software Support Section > search your computer or hardware model number > then your operating system > locate the correct drivers > download and install.

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    What are the other steps, which does not include some of the above:

    "Optimize Windows for better performance.

    http://Windows.Microsoft.com/en-us/Windows/optimize-Windows-better-performance#optimize-Windows-better-performance=Windows-7

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    It would be a good idea also run the System File Checker tool to check that everything is correct in the system files.

    "How to use the System File Checker tool to fix the files on system missing or corrupted on Windows Vista or Windows 7"

    http://support.Microsoft.com/kb/929833

    Use the (SFC.exe) System File Checker tool to determine which file is causing the problem and then replace the file. To do this, follow these steps:

    1. Open an elevated command prompt. To do this, click Start, click principally made programs, Accessories, right-click guest, and then click run as administrator. If you are prompted for an administrator password or a confirmation, type the password, or click allow.
    2. Type the following command and press ENTER:
      sfc/scannow

      The sfc/scannow command analyzes all protected system files and replaces incorrect versions with appropriate Microsoft versions.

    See you soon.

Maybe you are looking for