Copy link to clipboard
Copied
I use 'Select Extended' script quite often.
But there is no 'Select Blends' option. Is there a way to distinguish blended objects via DOM and JS?
I guess one draft way to do it is to read objects' names and search 'Blend', but I have no skill to do it myself. Please, help.
This is the only solution I think of.
not elegant, and not fast, but it works.
...function select_all_blends(){
var doc = app.activeDocument;
var plug = doc.pluginItems;
var plugLen = plug.length;
doc.selection = null;
var delMe, newPlugLen, finalSelection=[];
for(var i=0; i<plug.length; i++){
delMe = plug.duplicate(doc,ElementPlacement.PLACEATEND);
delMe.selected = true;
executeMenuCommand('Path Blend Release');
delMe = doc.sel
Copy link to clipboard
Copied
This is the only solution I think of.
not elegant, and not fast, but it works.
function select_all_blends(){
var doc = app.activeDocument;
var plug = doc.pluginItems;
var plugLen = plug.length;
doc.selection = null;
var delMe, newPlugLen, finalSelection=[];
for(var i=0; i<plug.length; i++){
delMe = plug.duplicate(doc,ElementPlacement.PLACEATEND);
delMe.selected = true;
executeMenuCommand('Path Blend Release');
delMe = doc.selection;
newPlugLen = doc.pluginItems.length;
app.cut();
if(newPlugLen == plugLen){
//found a blend
finalSelection.push(plug);
}
}
for(var i=0; i<finalSelection.length; i++){
finalSelection.selected = true;
}
}
select_all_blends();
Copy link to clipboard
Copied
Yes, it is more impudent than elegant!
But it actually works and I like it's audacity.
Thanks!
Copy link to clipboard
Copied
glad it helps
Copy link to clipboard
Copied
Qwertyfly... schrieb:
This is the only solution I think of.
not elegant, and not fast, but it works.
Not bad.
Only one note: you don't need the second loop.
function select_all_blends () {
var doc = app.activeDocument;
var plug = doc.pluginItems;
var plugLen = plug.length;
var count = 0;
doc.selection = null;
var delMe, newPlugLen, finalSelection=[];
for(var i=0; i<plug.length; i++) {
delMe = plug.duplicate(doc,ElementPlacement.PLACEATEND);
delMe.selected = true;
executeMenuCommand('Path Blend Release');
delMe = doc.selection;
app.cut();
if(doc.pluginItems.length == plugLen) {
//found a blend
finalSelection.push(plug);
finalSelection[count].selected = true;
count ++;
}
}
}
select_all_blends();
have fun
Copy link to clipboard
Copied
this will not work as you need to select each item to perform the executeMenuComand.
the selection is changing with each iteration through the loop.
the second loop is not an issue as it takes no time at all to run compared to the first loop
Copy link to clipboard
Copied
Oops.
You're absolutely right.
Copy link to clipboard
Copied
Another two options for selecting objects are covered here, in addition to the script mentioned by the OP:
Prepression: Illustrator – Selecting Similar Objects
Thanks for sharing Qwertyfly!
Copy link to clipboard
Copied
All methods mentioned there I know and use: Graffix plugin before it stopped working, Arid Ocean Map script on daily basis, Konstantin's script sometimes.
But thanks anyway.
Copy link to clipboard
Copied
I'm glad none of those can select blends.
else that would have been a waste of time nutting out...
Copy link to clipboard
Copied
No, it was worth it! Your help in scripting once more is very valuable for me so far.
Copy link to clipboard
Copied
Qwertyfly, your addition fills a gaping hole in the collection of selection scripts!
achegr, I was posting the link for others that may not know of these tools as this topic thread seemed a good place, glad you know of them.
Copy link to clipboard
Copied
I actually only new of 1 of them.
that was why I was glad none did blends when I checked them out...
I've spent ages nutting things out before, only to have someone provide a 1 line snippet that does a better job.
Copy link to clipboard
Copied
I think it's still better to be provided with 1-line-solution after hours of trying as a lesson, rather than spending hours without automation of single tasks as a dumb machine and then ask 3-lines-question at forums and get a splendid solution. The only better way is to spend hours to learn scripting and write everything myself and help other people (which is what you do).
Copy link to clipboard
Copied
I can never come up with good questions...
I rely on all of you to provide the problems that need solving...
and your right. there is nothing better then seeing someone do in 1 line what took me half a page.
I love clean elegant solutions.
sometimes I push it too far and lose readability...
there is a lot to be said for a script that you can understand after glancing over it once.
Copy link to clipboard
Copied
I like how executeMenuCommand gives us some creative ways to overcome some of these issues and solve unique problems. It's just enough of a push to be able to topple some stubborn mountains out there.
Copy link to clipboard
Copied
Hello test subjects...
I have been playing with Adobe CEP Panels
and I dropped this blend script in an addon and would like a few people to test it out.
i'ts more just to see that it works, and works on more then just my machine.
any help and feedback would be appreciated.
http://qwertyfly.com/files/illustrator_addons/Selector.zip
as extension manager has now been depreciated, here is a link to a basic replacement.
Anastasiy's Extension Manager for Adobe platform
Thanks in advance guys
Copy link to clipboard
Copied
Qwertyfly... написал(а):
Hello test subjects...
I have been playing with Adobe CEP Panels
and I dropped this blend script in an addon and would like a few people to test it out.
i'ts more just to see that it works, and works on more then just my machine.
any help and feedback would be appreciated.
http://qwertyfly.com/files/illustrator_addons/Selector.zip
as extension manager has now been depreciated, here is a link to a basic replacement.
Anastasiy's Extension Manager for Adobe platform
Thanks in advance guys
The notification about this got into spam, so I've only just tried to download the add-on. File seem to be missing,
Copy link to clipboard
Copied
bugger.
I made a spelling mistake.
http://qwertyfly.com/files/illustrator_plugins/Selector.zip
addons - plugins.
I thought I had tested it.
thanks for letting me know...
Find more inspiration, events, and resources on the new Adobe Community
Explore Now