Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Dear Harbs,
I new to scription and I dont know the scripting. Can you please explain in detail.
Prithivi
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Duh.
Of course! I always forget about invoking menu items...
Harbs
Copy link to clipboard
Copied
@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
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
ID still works! I've added clear transparency too:
https://github.com/GitBruno/Novelty/blob/master/Remove_Doc_Effects.jsx
Find more inspiration, events, and resources on the new Adobe Community
Explore Now