-
1. Re: help!!! Apply highlight to typed one in Dialog box
shilpa25 Dec 17, 2012 3:31 AM (in response to indegn5)hi,
try this, this should help you.. //
app.findGrepPreferences.findWhat = myText.text;
myText.onChanging = function () {$.Writeln (app.findGrepPreferences.findWhat.text)};
app.findGrepPreferences.fontStyle = "Regular";
app.changeGrepPreferences.appliedConditions = ["Condition 1"];
app.changeGrep();
thanks
shil...
-
2. Re: help!!! Apply highlight to typed one in Dialog box
davidDav Dec 17, 2012 4:55 AM (in response to shilpa25)hi forum,
using indegn5, script, i tried to create dropdownlist for fontstyle....
necessity is: if i type the text in editfield using selected fontstyle, the highlight should, if the document stories has the selected fontstyle...
but only the highlight is created and highlight is not applied to the selected font style...
can anyone look at this and make a tweak;
--------------------------
var myDoc = app.activeDocument;
var myDialog = new Window('palette', 'Highlight_unbold_Gobally');
var myGroup = myDialog.add('group', undefined, '');
myGroup.orientation = "column";
myGroup.add("statictext", undefined, "Type to find here");
var myText = myGroup.add("edittext", undefined, "");
myText.characters = 20;
myText.active = "true";
var arrays = ["select font style", "Regular", "Medium", "Bold", "Italic", "Bold Italic"];
var ddown= myGroup.add("dropdownlist", undefined, array);
ddown.minimumSize.width = myDialog.preferredSize = [300, 200];
ddown.selection = 0; ddown.active = true;
var newButton1 = myGroup.add('button', undefined, 'Highlight Words', {name:'Button'});
var newButton2 = myGroup.add('button', undefined, 'Clear Highlight', {name:'Button'});
myGroup.alignChildren = "center";
myDialog.show();
newButton1.onClick = function() {
myCondition = app.activeDocument.conditions.add ({name:"Highlight_Text",
indicatorMethod:ConditionIndicatorMethod.USE_HIGHLIGHT, indicatorColor:UIColors.YELLOW});
if (!myCondition.isValid) {
app.findGrepPreferences = NothingEnum.nothing;
app.changeGrepPreferences = NothingEnum.nothing;
}
app.findGrepPreferences.findWhat = myText.text;
myText.onChanging = function () {$.Writeln (app.findGrepPreferences.findWhat.text)};
for (i=0; i>arrays.length; i++){
array = arrays[i];
if (myText.appliedfontStyle.name == "");
ddown.onChanging = function () {$.Writeln (app.findGrepPreferences.appliedFontStyle = arrays.onClick)};
app.changeGrepPreferences.appliedConditions = ["Highlight_Text"];
app.changeGrepPreferences.appliedFontStyle = ["arrays"];
app.changeGrep();
}
}
newButton2.onClick = function()
{
myCondition.remove();
}

