How to sort layers by 123, instead, abc
I have the script. including the layers of sort in order of abc.
#target "Illustrator" /** * sort layers (with sublayer) */ var doc = app.documents[0]; var lay = doc.layers; var array_primary = []; for (var i=0, iL=lay.length; i < iL ; i++) { if (lay[i].layers.length === 0) { array_primary.push( lay[i].name ); } else { array_primary.push( lay[i].name ); var array_secondary = []; for (var j=0, jL=lay[i].layers.length; j < jL ; j++) { array_secondary.push(lay[i].layers[j].name); }; var result2 = array_secondary.sort( function (a,b) { return a > b }); // sort sublayers sort_layer (lay[i], result2); } }; var result1 = array_primary.sort( function(a,b) { return a > b } ); // sort layers sort_layer (doc, result1); function sort_layer (obj, array) { for (var ri=0, riL=array.length; ri < riL ; ri++) { obj.layers.getByName(array[ri]).zOrder( ZOrderMethod.SENDTOBACK ); }; }
For example, I layer names:
Layer # 116
Layer # 12
Layer # 117
Layer # 32
Layer n ° 3
This script sorting like:
Layer # 116
Layer # 117
Layer # 12
Layer n ° 3
Layer # 32
But I want to make to increase:
Layer n ° 3
Layer # 12
Layer # 32
Layer # 116
Layer # 117
Please, help me to do right!
Ch ch ch check it out!
The sort function is changed out of the non-numeric characters and then analyse int to be able to sort by the number vs string.
#target illustrator-20 function test(){ /** * sort layers (with sublayer) */ function sortNumeric(a, b){ a = a.replace(/[^\d]+/g, ''); b = b.replace(/[^\d]+/g, ''); return parseInt(a) > parseInt(b); }; var doc = app.documents[0]; var lay = doc.layers; var array_primary = []; for (var i=0, iL=lay.length; i < iL ; i++) { if (lay[i].layers.length === 0) { array_primary.push( lay[i].name ); } else { array_primary.push( lay[i].name ); var array_secondary = []; for (var j=0, jL=lay[i].layers.length; j < jL ; j++) { array_secondary.push(lay[i].layers[j].name); }; var result2 = array_secondary.sort( sortNumeric); // sort sublayers sort_layer (lay[i], result2); } }; var result1 = array_primary.sort( sortNumeric ); // sort layers sort_layer (doc, result1); function sort_layer (obj, array) { for (var ri=0, riL=array.length; ri < riL ; ri++) { obj.layers.getByName(array[ri]).zOrder( ZOrderMethod.SENDTOBACK ); }; } }; test();
Tags: Illustrator
Similar Questions
-
How you sort the list of the next iOS 10?
I can't know how to sort the list by following in-app music on my iPhone 6 s. In iOS 9, he had a handle on the right side next to the title of the song that you can tap and drag up/down to change the order of the playlist. The handle does not appear in the App on iOS 10 music.
So I guess you can't have activated repeat function. Once it is off, the handles appear and you can sort your list of songs until the next.
-
When you press the new tab, how can I get the homepage instead of the history of tiles?
When you press the new tab, how can I get the homepage instead of the history of tiles?
You can try this.
Instead of the parameter mentioned pref in about: blank, you can enter any site of your choice.
-
My iPod video 5th generation won't play of smart playlists in order with 12.4 iTunes, iTunes can not remember how to sort things either.
When you going to solve the problem?
Can I do to solve this problem?
Use the view of songs to set the order you want. Right-click on the name of the playlist in the left sidebar, and then select copy to Play Order in the context menu. Sort the list on the left most column of numbers, or use view > sort by > order of Playlist. Device synchronization.
TT2
-
Anyone know how to sort the files in windows 7.
Anyone know how to sort the files in windows 7. All of a sudden my file says "a long..., there is this month...» Last week... today. I can't deal with all the files in the folder now. How can I keep rid of one a long time ago..., this month... Last week... today) so that I can fix the whole folder?
Hello
Right-click on an empty area of the concerned window, select Group By, and then select None.
Best wishes
DP - K
-
Window Live Mail 2011 - was a bug - in the case of "sent" folder by clicking on the To: column head seems to sort emails by topic instead of field
In short, many users of Window Live Mail 2011 had the same problems. Please Microsoft Ltd fix!
1: you send messages in a forum XP and WLMail 2011 does not work on XP.
2: the Windows Live Mail Forum is located here.
http://www.windowslivehelp.com/forums.aspx?ProductID=15Bruce Hagen
MS - MVP October 1, 2004 ~ September 30, 2010
Imperial Beach, CA -
How to sort the files transferred to the computer
* Original title: file transfer
I have files that have names dates in them viz ' 1986 April 1986 may "etc and I have 3000 on my computer in order of date name but when I copy the file to transfer files on an another compluter resort themselves to Aprils all together can all June etc. Is there a way I can copy the files, but keep them in the same order?
Hi Anthony,.
I will definitely help you with this.
I suggest you to refer to the advice given by Divya R 19 January 2011 and check if it helps.
If the problem persists or you have any other questions, do not hesitate to let us know. It is our pleasure to be of service.
Thank you.
-
How to sort and organize the desktop icons in Windows Vista?
How do sort you the icons on the desktop by name or lock the desktop under Vista icons
Right-click on the desktop and click view.
To get the icons to stay where it is placed on the desktop.
Click on align on the grid and automatic uncheck their reorganization.
This will keep the icons of overlap between them.
Click on snap to grid.To have the icons align automatically:
The icons will be automatically aligned in the upper left corner of the office.
Click Auto arrange.Not sure if that's what you are meaning.
Let us know if that helps.Marilyn
-
How to boot to the desktop instead of metro?
How to boot to the desktop instead of metro?
You do not have. If you place the tile Office upstairs to the left of the position of the beginning of the screen, you can press ENTER after the connection to go straight to the office.
-
How can I sign in cursive instead of just text
How can I sign in cursive instead of just text?
Hi martinr83495760,
I would like to inform you that you can take the photo of your signature & who save as image on your system.
Then using tool fill & sign in Acrobat Reader ms, you can place your signature on the document Image.
See also this article:- with the help of Acrobat Reader DC fill & Sign
Kind regards
Christian
-
I have a x 113 leica and can load Lr 6 but it is 64-bit. My computer is 32-bit. How can I me 5.7 instead (which is 32-bit)? Thank you.
You might be able to buy LR 5.x from third-party vendors such as Amazon or B & H. Adobe does not sell older versions of Lightroom.
-
How to unlock layers?
If the layer of background, said you can drag the lock in the trash. If it isn't, then you can click the icon at the top of the layers panel that is enabled for this type of lock.
If you need more information, capture your layers panel with all the layers expanded so we can see what's happening. Also the OS of your computer, this is version and the version of Photoshop.
-
What is Tri merger and what the syntax or how to sort merge in the optimization of the performance
Hellonew IAM for performance how to sort merge and when to do it.
Thanks in advance.
Hello
Merge sort is a method to join two sets of results, which is essentially:
-First game on the join results sort key
-Then put spell on the join key
-Then merge them to produce the output
Like other methods (hash join, nested... loops joins) the cost of the operation is calculated by the CBO, which chooses the cheaper plan.
You can force the plan with the use_merge hint... but why would you do?
-
How to sort the videos Sony's AVCHD cam by DATE.
How to sort the videos Sony's AVCHD cam by DATE. 500 clips in media browser PP are not ordained. A little more of the FCP where appears the ingestation list, you check what you want and import. It looks different in PP. I dragged all the AVCHD folder on the camera (via the copy on the desktop Mac) media victory on PP. He broke them in 500. Video clips of MTS which cannot be classified by date. What should do?
Hi Pup8888,
pup8888 wrote:
Here is what I could not say. He pulls of a Sony 520 in ACVHD and somehow that the data CLEARLY arranged the clips in FCP do not appear in PP. Maybe it's the issue.
If you do not ingest the files through their structure to map intact complete with media browser and makes your entire organization in another application, Yes, I can see why some of the metadata is missing.
pup8888 wrote:
I also get a DEVICE NOT DETECTED in PP when the camera is clearly working in the new IMAC.
The remote control is not available for file based devices, so I don't think you need to worry about this.
pup8888 wrote:
So I do drag the AVCHD HD folder and import all in PP and yes it in busts. MTS files and works very well but unsortable by date. They are randomly dumped inn the media browser. Thoughts?
Can arrange you by date when they are ingested and in the project Panel? Arrange by date in the media browser would be a feature request. What to do here: http://www.adobe.com/go/wish
Thank you
Kevin -
How to duplicate layers & groups without automatically add a "copy", "copy 1", "# copy" at the end of the new group.
He has been harassing me for a while now, since I often work with the same elements over and over again. His frustration of having to change the name of each layer manually, especially if I copy an entire group.
Is there a setting in Photoshop or maybe an external script that can help solve this problem for me?
See you soon,.
Qiming
You can go to the Forum script:
Maybe you are looking for
-
Pop up multi line string causes missing "error".
I need to display a string of long text (multi line) in a pop-up message. If I do this with a very long string in the .c file it works (I have several \n in the chain so that it looks OK in the pop-. However, if I try to extend the string of text on
-
How do I uninstall the copy of Windows XP
Original title: HOW to UNINSTALL ACCIDENTAL DOUBLE INSTALL OF WINDOWS XP I accidently reinstalled Windows XP Professional on my Dell Latitude D620 and now starting, I gives me the choice of two operating systems XP Professional or XP Professional. Wh
-
printing problem: my model Z715 inkjet Lexmark it does not print
It worked fine before after after trying to remove the 2nd print order I have perhaps inadvertently deleted/removed some action / step, it has stopped working all together. Deletingthe printer and reinstall. Still, he does not what could have gone wr
-
Mac OS x print duplex LaserJet Pro 200 M276nw
I recently bought the HP LaserJet Pro 200 M276nw understand that I would be able to do manual duplex printing. However, after reviewing the instructions in the manual and try to understand through various blogs I can't always manually duplex. The ins
-
Materialized view automatically refresh? If the updating of the means how?
Materialized view refresh automatically? If the updating of the means how?