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

Unexpected selection after flatten transparency

Contributor ,
Nov 19, 2024 Nov 19, 2024

Copy link to clipboard

Copied

After you execute the “FlattenTransparency” command on a selected object, normally that object remains selected. However, in the following case, two objects, left and right, form a group that will be selected after the script completes.
The script pre-fills arrayNoFill, which contains one right clip group. Consequently, I expected that Flatten Transparency would not affect other objects. Why is this happening?

 

 

 

 

var arrayNoFill = [];
...
alert("Found " + arrayNoFill.length + " unfilled clipping mask(s)."); // found 1
alert('active layer: ' + doc.activeLayer.name);

// at this point nothing selected

for (var i = 0; i < arrayNoFill.length; i++) {
    arrayNoFill[i] = true;
}

#include "../path/flatten_transparency.jsx"

 

 

 

 

For some reason at this point the green shape is also selected and it makes group with the Clip Group on the right.

Screenshot_1.png

Here is an action string I found somewhere on the forum which I use here to flatten transaprenty: 

 

"/version 3 /name [ 7 466c617474656e ] /isOpen 1 /actionCount 1 /action-1 { /name [ 20 466c617474656e205472616e73706172656e6379 ] /keyIndex 0 /colorIndex 0 /isOpen 1 /eventCount 2 /event-1 { /useRulersIn1stQuadrant 0 /internalName (adobe_selectAll) /localizedName [ 10 53656c65637420416c6c ] /isOpen 0 /isOn 1 /hasDialog 0 /parameterCount 0 } /event-2 { /useRulersIn1stQuadrant 0 /internalName (ai_plugin_flatten_transparency) /localizedName [ 20 466c617474656e205472616e73706172656e6379 ] /isOpen 0 /isOn 1 /hasDialog 1 /showDialog 0 /parameterCount 5 /parameter-1 { /key 1920169082 /showInPalette 4294967295 /type (integer) /value 75 } /parameter-2 { /key 1919253100 /showInPalette 4294967295 /type (unit real) /value 300.0 /unit 592342629 } /parameter-3 { /key 1869902968 /showInPalette 4294967295 /type (boolean) /value 1 } /parameter-4 { /key 1869902699 /showInPalette 4294967295 /type (boolean) /value 1 } /parameter-5 { /key 1667463282 /showInPalette 4294967295 /type (boolean) /value 1 } } }"
 
It turns out this action has adobe_selectAll – how to properly remove it from there without snagging the extra?
 
 
TOPICS
Scripting

Views

143

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
Community Expert ,
Nov 19, 2024 Nov 19, 2024

Copy link to clipboard

Copied

It can be achieved by following this procedure. Or you can record the action yourself.

 

  1. Save the text of the action as a file and give it the aia extension
  2. Import it into Illustrator
  3. Delete Select All in the action panel
  4. Export it as aia
  5. Open the aia in a text editor and get the text

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 Expert ,
Nov 19, 2024 Nov 19, 2024

Copy link to clipboard

Copied

@sttk3 is it possible to remove "/internalName (adobe_selectAll) " text from the current string? I have not tested. - Mark

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 Expert ,
Nov 19, 2024 Nov 19, 2024

Copy link to clipboard

Copied

It is possible, but removing only that part should break aia. We need to remove the entire event and then match the eventCount with the actual.

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 Expert ,
Nov 19, 2024 Nov 19, 2024

Copy link to clipboard

Copied

LATEST

Interesting! Thanks.

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