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

Need script to remove the effects used in the layout for Indesign CS3 (mac version)

New Here ,
Mar 24, 2010 Mar 24, 2010

Dear All,

I am using Indesign CS3. I need to remove all the effects applied for boxes (text and image) in a document. Now I am doing this mannually by selecting the object and select the "Object-->Effect--. Clear effect". Is there any script is available for this? This will helpfull for me.

Prithivirajan

TOPICS
Scripting
2.0K
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
LEGEND ,
Mar 24, 2010 Mar 24, 2010

AFAIK there's no simple command to clear all effects. You need to loop

through all the transparency effects and turn them all off...

Harbs

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
New Here ,
Mar 24, 2010 Mar 24, 2010

Dear Harbs,

I new to scription and I dont know the scripting. Can you please explain in detail.

Prithivi

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
Enthusiast ,
Mar 24, 2010 Mar 24, 2010

Here is a non-traditional approach

var action = app.menuActions.itemByID(67880) if(action){      var doc = app.activeDocument;      for(var i=0; i<doc.spreads.length; i++){           doc.select(doc.spreads.allPageItems,SelectionOptions.REPLACE_WITH);           if(action.enabled){                action.invoke();           }      } }

id's don't usually change version to version.

It works on CS4, hopefully CS3 too.

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
LEGEND ,
Mar 24, 2010 Mar 24, 2010

Duh.

Of course! I always forget about invoking menu items...

Harbs

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 ,
Mar 24, 2010 Mar 24, 2010

@Stephen,
amazingly your script is working on an InDesign CS3 document. It seems that (all?) the IDs for menuActions did not change from CS3 to CS4.
Great!

A while ago I tried to gather a list of menuActions names and their IDs and wondered that there are thousends of ID numbers not applied to menuActions. Is there a relieable source of menuActions names and their IDs? Using itemByID would wonderfully circumvent a lot of localization problems when writing ExtendScript code with menuActions…

Uwe

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
LEGEND ,
Mar 24, 2010 Mar 24, 2010

Why isn't the right answer to use?:

var action= app.menus.item("$ID/Main").submenus.
  item("$ID/Object").submenus.
  item("$ID/ObjectEffects").menuItems.
  item("$ID/kClearEffects").

  associatedMenuAction;

(I'm not sure what happens when you call app.menuActions.itemByName("$ID/kClearEffects") -- you an object whose methods return an array of two of everything, e.g. enabled returns [false,false]. Perhaps using [0] all the time on it would be "better" somehow?)

Uwe, I get the names by walking the menu hierarchy and calling app.findKeyStrings() on the localized versions there. As noted elsewhere, you may get different results whether you prefix with "&" or not, but it's all there -- kind of.

postscript: also, MenuAction IDs are the same as MenuItem IDs, so presumably many of the "missing" numbers are from menus with no associated action?

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
Enthusiast ,
Mar 24, 2010 Mar 24, 2010

John Hawkinson wrote:

Why isn't the right answer to use?:

var action= app.menus.item("$ID/Main").submenus.
  item("$ID/Object").submenus.
  item("$ID/ObjectEffects").menuItems.
  item("$ID/kClearEffects").
  associatedMenuAction;

At the end of the day, your using the menu Action, so we can go there directly. Especially when there are sometimes issues with the names.

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
Enthusiast ,
Mar 25, 2010 Mar 25, 2010

Laubender wrote:

A while ago I tried to gather a list of menuActions names and their IDs and wondered that there are thousends of ID numbers not applied to menuActions. Is there a relieable source of menuActions names and their IDs? Using itemByID would wonderfully circumvent a lot of localization problems when writing ExtendScript code with menuActions…

John Hawkinson wrote:

postscript: also, MenuAction IDs are the same as MenuItem IDs, so presumably many of the "missing" numbers are from menus with no associated action?

The id is ActionID in the SDK. Each plugin gets assigned 256 numbers to use within plugin. So each plugin has the option of creating 256 menu actions. However since this is not usually the case, hence the missing ID's.

Since when updating plugin to new InDesign version a developer retains his slots therefor it is not probable that id's would be changed, though it is possible. I have an excel list with the name and id's for CS4 and would be glad to share if you contact me in prvt.

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
Explorer ,
Dec 08, 2016 Dec 08, 2016
LATEST

ID still works! I've added clear transparency too:

https://github.com/GitBruno/Novelty/blob/master/Remove_Doc_Effects.jsx

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