Reply To: select paragraph style from dropdown and dealing with targeting styles in folder

Home Page / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / select paragraph style from dropdown and dealing with targeting styles in folder / Reply To: select paragraph style from dropdown and dealing with targeting styles in folder

#1238023
Keith Gilbert
Participant

As far as allowing a user to choose a paragraph style, the talented Harbs made this function available on the Adobe Scripting forum years ago. I’ve used this as well and it works great.

function myInput (myDoc) {
// Thanks to Harbs for the pstyle listview code! https://forums.adobe.com/thread/445911
var HarbsUI = {}
HarbsUI.TreeView = function(parent,structure,name,nodeIcon,bounds){
if(bounds instanceof Array){
var width = bounds[0] || undefined;
var height = bounds[1] || undefined;
}
// Create the panel for the TreeView
var panel = parent.add(“panel”, undefined, name);
panel.alignment = [“fill”, “fill”];
panel.alignChildren = [“fill”, “fill”]
// Create the TreeView list
var treeview = panel.add(“treeview”);
if(width){treeview.preferredSize.width = width;}
if(height){treeview.preferredSize.height = height;}
AddItemsToTreeView(treeview,structure,nodeIcon);
return treeview;
function AddItemsToTreeView(parent,structure,icon){
for(var i=0;ihttps://forums.adobe.com/thread/445911
function GetStylesWithGroups(doc,groupType,styleType,parent,dontSkipFirst) {
var retVal=[];
var styles = parent[styleType];
for(var i=0;i

This article was last modified on April 13, 2020

Comments (0)

Loading comments...