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

Iterate shapes and convert them to Compound Shapes

Community Beginner ,
Nov 21, 2014 Nov 21, 2014

Copy link to clipboard

Copied

In order to keep shapes as shape layers in Photoshop when exporting from .ai to .psd, one has to convert all shapes to Compound Shapes.
At the moment, i'm using an action that converts the shape, then selects the shape above. Starting with the bottom shape, i have to click

the action for every shape.

Is there a way to make a script cycle through all shapes and groups, converting them to Compound Shapes?

At the end of the script, it would be nice to have it make an export of the file to .psd aswell.

I'm somewhat familiar to javascript, but i would really appreciate some guidelines in creating this.

TOPICS
Scripting

Views

1.3K

Translate

Translate

Report

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
Adobe
Valorous Hero ,
Nov 24, 2014 Nov 24, 2014

Copy link to clipboard

Copied

Are you using CC, or at least CS6?  Are the items you need to be thus converted just top-level items in a top-level layer?  Because that can be done!  Otherwise, it can also be done with more work..

Votes

Translate

Translate

Report

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 Beginner ,
Nov 25, 2014 Nov 25, 2014

Copy link to clipboard

Copied

I'm on CS5. I don't fully understand what you are suggesting i'm sorry. I need all shapes in all layers to be converted.
I've come up with a script that converts all shapes to compound shapes, but they need to be converted via the options

in the Pathfinder panel. Otherwise Photoshop won't make them into shape layers. I don't know why this is.

Votes

Translate

Translate

Report

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 ,
Nov 25, 2014 Nov 25, 2014

Copy link to clipboard

Copied

Okay, CS5.. are you on PC or Mac now?

Votes

Translate

Translate

Report

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 Beginner ,
Nov 25, 2014 Nov 25, 2014

Copy link to clipboard

Copied

Windows 7 64bit.

Votes

Translate

Translate

Report

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 ,
Nov 25, 2014 Nov 25, 2014

Copy link to clipboard

Copied

Ok, do you use AutoHotKey already?  The solution I am thinking of, involves using AHK scripts to trigger the action which makes the compound shape.

Votes

Translate

Translate

Report

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 Beginner ,
Nov 25, 2014 Nov 25, 2014

Copy link to clipboard

Copied

Yes i do use AHK for some minor stuff. I've never done any big complex scripts.
Do you have any ideas how i should build it?
The only thing i can come up with is to map the action to an F-key. Then make the

AHK perform som click-actions when i press the F-key. But how will AHK know when there

is'nt any more shapes to convert?
As i said, i'm not anywhere near a true AHK-haxXer

Votes

Translate

Translate

Report

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 ,
Nov 25, 2014 Nov 25, 2014

Copy link to clipboard

Copied

It okay is, because this will be great learning for our minds!  There is a way, to have your Extendscript execute the AHK script which tells it to "send" the F-keys as if it came from your keyboard.  The action will go, but I am not very clear on how out of synch the action will be with the script.  At first thought , putting $.sleep() may do the trick, especially if your action does not take long & there's not a big chance of it having to take long.  Well, anywho, after the time break, it will go do its script thing, which is select the next shape or group (pageItem).  And at the end, hey, you can try tacking on the PSD saving using the export with ExportOptionsPhotoshop- but that's later!  imagecollection has some examples here of executing an AHK script from the jsx script, check 'em out!

Votes

Translate

Translate

Report

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 Beginner ,
Nov 25, 2014 Nov 25, 2014

Copy link to clipboard

Copied

Thanks for the support!
I can't find any posts on the subject over at imagecollections profile, could you be more precise?

Votes

Translate

Translate

Report

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 ,
Nov 25, 2014 Nov 25, 2014

Copy link to clipboard

Copied

I am going to try and put a snippet together of the example proposed above, but it's all new to me

Votes

Translate

Translate

Report

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 ,
Nov 25, 2014 Nov 25, 2014

Copy link to clipboard

Copied

I'll chime in.

first to get a handle on what your doing.

by shape do you mean pathItem.

can you show or explain what your action does step by step?

it sound like you just want a script to loop through all items converting each one to a compound Path.

Votes

Translate

Translate

Report

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 ,
Nov 25, 2014 Nov 25, 2014

Copy link to clipboard

Copied

The Compound Shape is different from Compound Path, especially to us because it is a "PluginItem" according to the DOM.  A plugin item is like a mystery box!  Also, any fancy CS6+ commands to run actions aren't an option because CS5. 

Votes

Translate

Translate

Report

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 ,
Nov 25, 2014 Nov 25, 2014

Copy link to clipboard

Copied

create a shortcut for the action.

go to the last step in the action(Select next object above)

hit record, then press shortcut for the action.

stop recording.

So now the action calls itself.

select the bottom item on the page.

run action.

it will loop through all items then finish by getting stuck in a loop.

so you do need to press stop.

Quicker then running it over and over manually.

Votes

Translate

Translate

Report

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 Beginner ,
Nov 25, 2014 Nov 25, 2014

Copy link to clipboard

Copied

Actually i tried that, but it's not possible for an action to record a playback of itself.

I did managage to get it working though combining two actions.
It is working, but i don't like the fact that i have to manually stop it.

Votes

Translate

Translate

Report

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 ,
Nov 26, 2014 Nov 26, 2014

Copy link to clipboard

Copied

LATEST

I Got it to work by assigning shift+F11 to the action then while recording pressed that short cut.

its not ideal at all bit much quicker then pressing shift+F12 over and over.

if you had a later version that allowed actions run from javascript it would be cleaner.

Votes

Translate

Translate

Report

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