Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Select blends only

Engaged ,
Oct 27, 2015 Oct 27, 2015

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.

TOPICS
Scripting
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Oct 27, 2015 Oct 27, 2015

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

...
Translate
Adobe
Guide ,
Oct 27, 2015 Oct 27, 2015

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();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 27, 2015 Oct 27, 2015

Yes, it is more impudent than elegant!

But it actually works and I like it's audacity.

Thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 27, 2015 Oct 27, 2015

glad it helps

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 28, 2015 Oct 28, 2015

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 28, 2015 Oct 28, 2015

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 28, 2015 Oct 28, 2015

Oops.

You're absolutely right.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 27, 2015 Oct 27, 2015

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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 27, 2015 Oct 27, 2015

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 27, 2015 Oct 27, 2015

I'm glad none of those can select blends.

else that would have been a waste of time nutting out...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 27, 2015 Oct 27, 2015

No, it was worth it! Your help in scripting once more is very valuable for me so far.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 27, 2015 Oct 27, 2015

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 27, 2015 Oct 27, 2015

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 27, 2015 Oct 27, 2015

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).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 27, 2015 Oct 27, 2015

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Oct 28, 2015 Oct 28, 2015

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 28, 2015 Oct 28, 2015

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 29, 2015 Oct 29, 2015

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,

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 29, 2015 Oct 29, 2015
LATEST

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...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines